Need help again!
The code seems to work fine (But gives TLE), I want to further optimise it by memoisation.
Can anyone please guide me on how to do that?
PS: I did use a dp array to implement memoisation but it seems to give wrong answer.
Thanks in advance