LeetCode 55. Jump Game (Algorithm Explained)

preview_player
Показать описание


Preparing For Your Coding Interviews? Use These Resources
————————————————————

Other Social Media
----------------------------------------------

Show Support
------------------------------------------------------------------------------

#coding #programming #softwareengineering
Рекомендации по теме
Комментарии
Автор

That algorithm explanation section helps so much

nimanizky
Автор

This is simply beautiful! You've really taught me something on how to think about a solution approach! Thank you Nick!

azfarzaidi
Автор

That was some clean explanation Nick. I was aware of only the O(n2) solution. Keep it up.

ravishekhawat
Автор

Absolutely loved the explanation and how you broke it down into smaller sub problems! Superb stuff!

yashsheth
Автор

Nice Explanation. But technically I don't think we have to start from last Index as we are moving from behind and we dont care whats the value in the last index as we have reached there. (On line 4, we can start from lastGoodIndexPosition-1 (which is num.length-2))

sumanmallipeddi
Автор

i was strugling with the sol from last 3 days but you made it clear in just 10 min kudos for your efforts

Harjotse
Автор

Now that's a simple and efficient solution, combined with good explanation. I didn't even think of going backwards, just tried to brute-force it recursively.

Fapados
Автор

This method seems a lot easier than trying to do it via DFS/Backtracking. You could also start the loop from "last_good_index_position -1" or nums.size()-2 as long as LGIP is initialized as nums.size()-1. It would mean one less loop required which probably makes minimal difference in terms of speed.

johnnywilson
Автор

nick my brother you don't know how much ur videos help me in building approach and solving a problem. Your approach are always better than others please keep on making such videos.

satyamgupta
Автор

love the way you explain the code using dry runs

vivekgr
Автор

the last index's value does not matter so we can skip it by doing nums.length -2 instead of nums.length -1 in the loop

duongvuhai
Автор

This is actually quite neat. It only does whatever the questions asks.. nothing more. We don't really need to explore all possibilities when we only need to return whether or not it's possible to reach the last index. Cool solution this

DurgeshYadav-bcnm
Автор

This is the best and easy-understanding solution I can tell. Thank you dude, excellent

jamesgeng
Автор

Love your video and the way you are talking dude!

bulianxile
Автор

thanks for the video, but your small rectangle bottom-left corner covers some of the code part/writing when you're explaining.

satang
Автор

Nick since the return type asked is boolean, keep the return values as true and false, other than i and 0. good explaination. understood it

rosonerri-faithful
Автор

Well the approach is so good and explained really well.Thanks Nick.

BadriBlitz
Автор

another great solution, sweet and simple.

satyamgupta
Автор

Thank a bunch Nick, it was so much clearer after your explaining.

seshafermi
Автор

best explanation I have seen for this problem !! thanks Nick !

sitaramakella
welcome to shbcf.ru