I am not unable to get the idea . Please help me
I came across this problem, and thought to myself; this is classical DP that can be solved with memoization, specially when I saw that N <= 100.
But I got wrong answer on test 6.And when I read the...
I am not able to understand your code(Very bad at reading code) .
But this is my dp solution works fine and is Ac :-)