Minimum jumps required

Why I am getting wrong output on submission while sample test is passed ?

Can you please point out the error in my code? I am trying to solve this problem using dp.

this is i suppose a greedy approach based.

Since I am using recursion + memoization, please explain how this will be a greedy approach ?


please watch this video the best explanation

Solved it using the condition
if(a[i]==0)
return INT_MAX - 2

1 Like