Https://ide.codingblocks.com/s/170875

i don’t know whats going wrong please help

Hey Sathak! I ran your code and there are a number of mistakes at the link you provided:

  1. You have commented out the memo due to which it’s running indefinitely
  2. Your last index in your array is supposed to be n and not n-1 because you have chosen 1 indexing and not 0 indexing in your array
  3. An important base case is missing, when the index becomes greater than the last index, think about it?
  4. And most importantly,your final ans is the minimum of all recursion calls and not the sum of them.

Check out all of these yourself and if still problem assists, I will be more than happy to make changes in your code! Thanks!