Jump Game II | Live Coding with Explanation | Leetcode - 45

  Рет қаралды 26,233

Algorithms Made Easy

Algorithms Made Easy

Күн бұрын

Пікірлер: 43
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
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!!!🙂🙂🙂
@shreyasingh7833
@shreyasingh7833 3 жыл бұрын
This video was really helpful to understand both dp and greedy approach for this problem !!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad you like it !!
@smtechsolutions3527
@smtechsolutions3527 Жыл бұрын
Very great explanation
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy Жыл бұрын
Glad you think so!
@i.vigneshdavid1698
@i.vigneshdavid1698 3 жыл бұрын
Last Solution Perfect. For this simple approach i used memoization. Thanks for this good one
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks!!
@pranjalbansal3862
@pranjalbansal3862 2 жыл бұрын
can anyone tell me what is the use of i+nums[i] in j
@hymnish_you
@hymnish_you 3 жыл бұрын
lit explanation. You deserve much buddy
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks!!! 🙂
@pradiptalekar7545
@pradiptalekar7545 3 жыл бұрын
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.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
Thank you!!
@uditagrawal6603
@uditagrawal6603 2 жыл бұрын
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?
@uditagrawal6603
@uditagrawal6603 2 жыл бұрын
For making this work we can put a check if at any instant i>end then there does not exist. WDYT?
@techmoon_
@techmoon_ 3 жыл бұрын
Great explanation but still couldn't get it!!!
@hymnish_you
@hymnish_you 3 жыл бұрын
Oh god, greedy approach was so awesome. How you come to it?
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Took a while to think about it. All credited to the practice!! 🙂
@rahulbawa6864
@rahulbawa6864 2 жыл бұрын
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?
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
yes
@mahboobhasan2137
@mahboobhasan2137 2 жыл бұрын
awesome sir thanks for this video
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Most welcome !!
@memesofengineer9627
@memesofengineer9627 2 ай бұрын
What is the use of begin in the code ??
@rohith2714
@rohith2714 3 жыл бұрын
thanks
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
Thank you!!
@vinodkrishnan3571
@vinodkrishnan3571 6 ай бұрын
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 .
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
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.
@johnademola528
@johnademola528 3 жыл бұрын
You actually did not use the begin variable but really great explanation guys
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Yes, The beginning was nothing but the index so doesn't make sense to be used! Btw thanks! 🙂
@sandeepnallala48
@sandeepnallala48 3 жыл бұрын
checking if someone else got same dbt ... thanks : )
@muthuvalli333
@muthuvalli333 3 жыл бұрын
Perfect...😀
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks
@pravin4218
@pravin4218 2 жыл бұрын
2:59 how jump from 3 to 4 is 1 ?? we have two elements in between right it should be 3 na??
@ranjithsubramaniam5930
@ranjithsubramaniam5930 2 жыл бұрын
you haven't used the "begin" variable, hopefully, you can replace the i variable with "begin".
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
yes, can be removed.
@bolt6572
@bolt6572 8 ай бұрын
I am so confused. Why are we adding index values? Can someone explain?
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 5 ай бұрын
because from this particular index we can go to index equal to i + nums[i].
@rhythmbhatia8906
@rhythmbhatia8906 2 жыл бұрын
Explanation for greedy approach is not clear!
@saiyashwanth1991
@saiyashwanth1991 3 жыл бұрын
everything is good , but you didn't use begin pointer in the end though you declared it. Good efforts appreciated !
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Yes, Since the index is the beginning for any value, using it didn't make any sense.
@saiyashwanth1991
@saiyashwanth1991 3 жыл бұрын
@@AlgorithmsMadeEasy I get that , just pointed out unused variable.
@codenchill732
@codenchill732 3 жыл бұрын
tried so many approaches but failed
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Hope this video helped you
Jump Game III | Live Coding with Explanation | Leetcode - 1306
6:35
Algorithms Made Easy
Рет қаралды 8 М.
How many people are in the changing room? #devil #lilith #funny #shorts
00:39
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 4,9 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 82 МЛН
Frog Jump | Live Coding with Explanation | Leetcode - 403
18:21
Algorithms Made Easy
Рет қаралды 10 М.
Jump Game II - Greedy - Leetcode 45 - Python
11:58
NeetCode
Рет қаралды 210 М.
Candy | Live Coding with Explanation | Leetcode -135
18:09
Algorithms Made Easy
Рет қаралды 14 М.
L5. Jump Game - II | Greedy Algorithm Playlist
16:45
take U forward
Рет қаралды 69 М.
Course Schedule III | Live Coding with Explanation | Leetcode - 630
13:38
Algorithms Made Easy
Рет қаралды 11 М.
55. Jump Game || 4 examples to build logic + code
15:30
Code with Alisha
Рет қаралды 13 М.
Gas Station | Live Coding with Explanation | Leetcode - 134
13:56
Algorithms Made Easy
Рет қаралды 18 М.
Jump Game II - LeetCode 45 - Greedy Algorithm - Coding Interview
5:54
#Leetcode 45 Jump Game 2 || Code + Explanation + Example Walkthrough
12:42
How many people are in the changing room? #devil #lilith #funny #shorts
00:39