Minimum Jumps Required

Test cases not passing. Code seems correct and passes sample case.

@Aditya.Jethliya see according to your code and indexing, end of array is at n-1 index because you are taking from 0. So modify and correct your code accordingly at all the places. like i + arr[i] >= n-1 .

Also when you are calculating the jump using other elements, you have initialized minimum variable with INT_MAX.
But after calculating you are directly assigning dp[i] = 1 + minimum, think what if minimum=INT_MAX, then in that dp[i] will not be able to hold it because it is int type and can hold maximum till INT_MAX.
so modify it also.

Feel free to ask if want any help in implementing these changes code.

Thank you so much!!! I implemented above changes and it worked.

@Aditya.Jethliya Please mark this doubt as resolved as you have solved the problem.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.