We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!! Questions you might like: ✅✅✅[ Tree Data Structure ] : kzbin.info/aero/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls ✅✅✅[ Graphs Data Structure ] : kzbin.info/aero/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C ✅✅✅[ January Leetcoding Challenge ] : kzbin.info/aero/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn ✅✅✅[ December Leetcoding Challenge ] : kzbin.info/aero/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA ✅✅✅[ November Leetcoding Challenge ] : kzbin.info/aero/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e ✅✅✅[ August Leetcoding Challenge ] : kzbin.info/aero/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe ✅✅✅July Leetcoding challenges: kzbin.info/aero/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC- ✅✅✅June Leetcoding challenges: kzbin.info/aero/PLJtzaiEpVo2xIfpptnCvUtKrUcod2zAKG ✅✅✅May Leetcoding challenges: kzbin.info/aero/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e ✅✅✅Cracking the Coding Interview - Unique String: kzbin.info/aero/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE Struggling in a question?? Leave in a comment and we will make a video!!!🙂🙂🙂
@shreyasingh78333 жыл бұрын
This video was really helpful to understand both dp and greedy approach for this problem !!
@AlgorithmsMadeEasy3 жыл бұрын
Glad you like it !!
@smtechsolutions3527 Жыл бұрын
Very great explanation
@AlgorithmsMadeEasy Жыл бұрын
Glad you think so!
@i.vigneshdavid16983 жыл бұрын
Last Solution Perfect. For this simple approach i used memoization. Thanks for this good one
@AlgorithmsMadeEasy3 жыл бұрын
Thanks!!
@pranjalbansal38622 жыл бұрын
can anyone tell me what is the use of i+nums[i] in j
@hymnish_you3 жыл бұрын
lit explanation. You deserve much buddy
@AlgorithmsMadeEasy3 жыл бұрын
Thanks!!! 🙂
@pradiptalekar75453 жыл бұрын
Good one guys. Your content is really awesome, simple, and easy to understand for interview preparation. Wish to see more things coming up on your channel like System Design etc.
@AlgorithmsMadeEasy5 ай бұрын
Thank you!!
@uditagrawal66032 жыл бұрын
Second approach will only work with the assumption that there always exist a path to last index, which is also specified in the question itself. Am I correct?
@uditagrawal66032 жыл бұрын
For making this work we can put a check if at any instant i>end then there does not exist. WDYT?
@techmoon_3 жыл бұрын
Great explanation but still couldn't get it!!!
@hymnish_you3 жыл бұрын
Oh god, greedy approach was so awesome. How you come to it?
@AlgorithmsMadeEasy3 жыл бұрын
Took a while to think about it. All credited to the practice!! 🙂
@rahulbawa68642 жыл бұрын
I suppose, the last if condition in the first solution is to make sure we increase only when we can really reach or exceed the end. Right?
@AlgorithmsMadeEasy5 ай бұрын
yes
@mahboobhasan21372 жыл бұрын
awesome sir thanks for this video
@AlgorithmsMadeEasy2 жыл бұрын
Most welcome !!
@memesofengineer96272 ай бұрын
What is the use of begin in the code ??
@rohith27143 жыл бұрын
thanks
@AlgorithmsMadeEasy5 ай бұрын
Thank you!!
@vinodkrishnan35716 ай бұрын
have a doubt how can we handle if we have a zero value ? example [1,2,0,3,5] now in step one we got to reach 5 from 5 we need 0 steps and from 3 to 5 we need only 1 now what to do if we have 0 ( i mean we can't reach anywhere from here so what to fill in our jump carrier array?) please reply asap 🙂 Thank you .
@AlgorithmsMadeEasy5 ай бұрын
The value at 0 steps would remain Integer.maxValue. Since if this point would have been the first point we would have never reached the end.
@johnademola5283 жыл бұрын
You actually did not use the begin variable but really great explanation guys
@AlgorithmsMadeEasy3 жыл бұрын
Yes, The beginning was nothing but the index so doesn't make sense to be used! Btw thanks! 🙂
@sandeepnallala483 жыл бұрын
checking if someone else got same dbt ... thanks : )
@muthuvalli3333 жыл бұрын
Perfect...😀
@AlgorithmsMadeEasy3 жыл бұрын
Thanks
@pravin42182 жыл бұрын
2:59 how jump from 3 to 4 is 1 ?? we have two elements in between right it should be 3 na??
@ranjithsubramaniam59302 жыл бұрын
you haven't used the "begin" variable, hopefully, you can replace the i variable with "begin".
@AlgorithmsMadeEasy5 ай бұрын
yes, can be removed.
@bolt65728 ай бұрын
I am so confused. Why are we adding index values? Can someone explain?
@AlgorithmsMadeEasy5 ай бұрын
because from this particular index we can go to index equal to i + nums[i].
@rhythmbhatia89062 жыл бұрын
Explanation for greedy approach is not clear!
@saiyashwanth19913 жыл бұрын
everything is good , but you didn't use begin pointer in the end though you declared it. Good efforts appreciated !
@AlgorithmsMadeEasy3 жыл бұрын
Yes, Since the index is the beginning for any value, using it didn't make any sense.
@saiyashwanth19913 жыл бұрын
@@AlgorithmsMadeEasy I get that , just pointed out unused variable.