Sort 28 Discussions, By:
Please Login in order to post a comment
Try Coin change algo in node js
If you get stuck, don't forget to check out this video. The best explanation you need to know before solving this problem.
Can't seem to figure out why I'm getting the wrong answer for 6 and 7. I'm not timing out. I'm using the recursive p[n] formula using the pentagonal numbers. Can anyone tell me is this the solution for the following test case (assume line breaks rather than spaces, it just doesn't post that way when I load the comment)
Keyword for this problem is integer partition algorithm.
There are many unreliable codes in the internet, so you should choose the one that has time = O(n^1.5)
If you're failing test cases 6 and 7 due to Runtime Error it might be because you're reaching the maximum recursion depth, set the following will let you increase the limit: