I am getting wrong answer?
Sharad, you are supposed to solve this question using the 1-d dynamic programming approach as this problem consists of the overlapping subproblems… if you havent read about dp, you can skip this question and can complete later on once you are through with the basic concepts of dynamic programming…
but we are required to solve this problem under recursion challenges
Yes, its given under recursion section but the code will not be submitted without using dp in your code because of large constraints… so pls solve using tht only