Minimum jumps required

https://ide.codingblocks.com/s/235854 it is giving segmentation fault please help

@Learning_bunny inside while loop, you are running for loop from d+1 to cur now cur can be smaller than the value of d so for loop would not run, d would not be updated leading to infinite loop.

so how to correct it

@Learning_bunny Hey you can look at this code for correct code implementation


If this resolves your doubt mark it as resolved.

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.