TLE is coming in the test cases

Are you able to see my code, I think it’s right, but TLE is coming in all leaving the one case

@divyansh0003
hello divyansh,
u need to use dynamic programming to pass all test cases. recursive solution will give tle because time complexity is rounghly 2^n.