I have used a slightly different approach. Can you please see it? https://ide.codingblocks.com/s/307602
Problem in memoization
I figured it out. Correct code: https://ide.codingblocks.com/s/307606 (Changed line 21 ) Please tell me why previous code was wrong
I first code u have 2 changing parameter and u have memoized for only one parameter. But in second u have optimised, and it has only one changing parameter and memoization is also on one parameter