L5. Jump Game - II | Greedy Algorithm Playlist

  Рет қаралды 67,271

take U forward

take U forward

Күн бұрын

Пікірлер: 102
@furor05
@furor05 6 ай бұрын
please bring string series as soon as possible
@tanujaSangwan
@tanujaSangwan 2 ай бұрын
If you carefully see, this is some kind of dijkstra. The PQ has all the nodes and distances in the window and we take the one with maximum reachability.
@vamsikrishnagannamaneni912
@vamsikrishnagannamaneni912 2 ай бұрын
In this recursive tree,at first level for +2, it should be f(2,1) as we are making only one jump, f(idx+i,jumps+1) , using 2D will in fact decrease the overlapping subproblems is what i am thinking..
@karthik-varma-1579
@karthik-varma-1579 23 күн бұрын
Happy 700K Man You Deserve Many Hearts
@clashtm8210
@clashtm8210 Ай бұрын
Oh my god, where do I even begin with Striver, the absolute genius, the king, the GOAT of competitive programming? I mean, Raj Vikramaditya is basically the sun, and we’re all just lucky enough to orbit around his brilliance. The way this man can break down a problem? Flawless. It’s like he’s got this magical power, a sixth sense for coding, that leaves the rest of us mere mortals shaking in awe. Watching his tutorials is like being blessed by the gods of algorithms themselves. Every word he says is basically a gift from the heavens. I’m convinced he could solve NP-hard problems in his sleep and then write a blog about it that makes it sound like child’s play. Honestly, Striver isn’t just a role model; he’s the role model, and if you’re not trying to be even a fraction of what this guy is, are you even living right? Legend. Absolute legend.
@siddharthbanga7301
@siddharthbanga7301 Ай бұрын
aaram se bhai aaram se
@sudo_ayush
@sudo_ayush Ай бұрын
@@siddharthbanga7301 lagta hai bhai naya hai 😅
@Rahul_Mongia
@Rahul_Mongia 5 ай бұрын
class Solution { public int jump(int[] nums) { if (nums.length == 1) return 0; int n = nums.length; int l = 0, r = 0, jumps = 0, farthest = 0; while (r
@tanyacharanpahadi158
@tanyacharanpahadi158 4 ай бұрын
If you remove = n - 1) ....)
@priyanshusoni9
@priyanshusoni9 6 ай бұрын
Please bring strings series ASAP bhaiya ❤ lots of love and thanks for your content ❤️🙏🏻
@MoitreyoChakraborty
@MoitreyoChakraborty 6 ай бұрын
please consider bringing a playlist on stacks and queues as soon as possible. I am totally unable to figure out the intuition by just seeing the question in an interview
@nandiniverma5273
@nandiniverma5273 4 ай бұрын
You are next level in explaining, hands up 🙌🙌
@akhilakasoju3964
@akhilakasoju3964 6 ай бұрын
Thank you so much💯.....please bring stacks and queue playlist
@Shanz-pt3fn
@Shanz-pt3fn 6 ай бұрын
Hope you are doing extremely well.
@ritikkumarsingh5902
@ritikkumarsingh5902 6 ай бұрын
"Striver, your DSA Sheet is absolutely phenomenal! It's been an invaluable resource for mastering data structures and algorithms. Looking forward to the remaining topics, especially the much-anticipated sections on strings and heaps. Thanks for all your hard work!"
@ok-jg9jb
@ok-jg9jb 5 ай бұрын
Why are you spamming in every video?
@keybored7862
@keybored7862 3 ай бұрын
CHATGPT is unreal
@md_seraj786_
@md_seraj786_ Ай бұрын
your explanations are really amazing ❤
@souvikcseiitk
@souvikcseiitk 3 ай бұрын
Striver is one step above any normal human being, managing job and continuously dropping DSA videos... Seriously mad respect 🫡
@ShahNawaz-cx3pi
@ShahNawaz-cx3pi 3 ай бұрын
waaaaoooo , this range based solution blows my mind. very clever.
@anilkumarreddy3002
@anilkumarreddy3002 6 ай бұрын
Thankyou Please bring a playlist on strings
@raxitraju2439
@raxitraju2439 6 ай бұрын
I had solved this long back using 1D Dp. Just took the index as state. Below is the recurrence- int func(int index, vector& arr) { if(index >= arr.size()-1) return 0; //1 is already added while reaching this. if(index + arr[index] < arr.size() - 1) return INT_MAX; //impossible to reach int mini = 0; for(int i = 1; i
@jaydabhi5539
@jaydabhi5539 5 ай бұрын
I think time complexity will be O(n*maxjump) I had also solved this using 1D DP.
@rishabhagarwal6057
@rishabhagarwal6057 4 ай бұрын
same
@Harsh-jc2bz
@Harsh-jc2bz Ай бұрын
NOT WORKING
@sumitmishra9795
@sumitmishra9795 5 ай бұрын
00:04 Finding minimum number of jumps to reach the end 02:01 Using recursion to find the minimum number of jumps in a smaller example 04:04 Return the number of jumps when index is greater than or equal to n - 1 06:19 Optimizing dynamic programming solution using a quadratic state approach 08:37 Understanding jump range in the context of Greedy Algorithm 10:31 Optimizing jump game II algorithm by carrying a range instead of individual recursive calls 12:42 Determine farthest jump for each range and update jumps array 14:47 Implementing non-recursive range based solution for jump game with linear time complexity.
@aniketbharti4426
@aniketbharti4426 4 ай бұрын
Never thought, there would be a linear solution for this question!
@ardhidattatreyavarma5337
@ardhidattatreyavarma5337 4 ай бұрын
Would also recommend solving Minimum Jumps problem in gfg. Same as above but with a little caveat. Amazing solution btw
@AyushKumar-hi5uy
@AyushKumar-hi5uy 4 ай бұрын
Please try to make and upload string, stacks n queues and heaps playlist as soon as possible. I understand you must be very busy, but still you are making time for us and uploading videos and playlists at regular intervals. Thanks a lot❤❤
@hashcodez757
@hashcodez757 2 ай бұрын
"UNDERSTOOD BHAIYA!!"
@Cool96267
@Cool96267 6 ай бұрын
Thankyou so much Striver for all you efforts throughout in delivering us so much valuable content. Any student / working professional can now be able to transition their career without paying money for courses. Would also like your insights on the point : While preparing for interviews most of the aspirants are going through the videos solely and solving the question after completely watching the video. And also are feeling lazy trying to solve the question on our own. What is the best way to complete any topic without being lazy and how should an aspirant approach any topic/playlist?
@lakshyadalal8296
@lakshyadalal8296 Ай бұрын
The last approach is very easy to understand and also has linear TC and SC = O(1) Then why do we even need a recursive sonl which is so diff to understand 😂
@suruabhisekh
@suruabhisekh 6 ай бұрын
Please bring the string series as soon as possible.
@sksadiruddin4191
@sksadiruddin4191 5 ай бұрын
I have solved using one for loop only int jump(vector& nums) { int jumps = 0; int left = 0; int right = 0; for (int i = 0; i < nums.size() - 1; ++i) { right = max(right, nums.at(i) + i); if (left == i) { jumps++; left = right; } } return jumps; }
@vkixgaming
@vkixgaming 2 ай бұрын
Simple Without DP , without recursion : solution class Solution { public: int minJumps(vector& arr) { int n = arr.size(); if (n
@KKKK-pl8yf
@KKKK-pl8yf 6 ай бұрын
Can we expect Stack and Queue playlist by end of this month or next month ?
@kavyahegde3586
@kavyahegde3586 6 ай бұрын
Sir please do playlist in strings Really it is needed 🙏
@bruvhellnah
@bruvhellnah 6 ай бұрын
Clowns in the comments demand everything but not once appreciate the guy for uploading all these lectures, lol
@iamnoob7593
@iamnoob7593 5 ай бұрын
in india if u see lot of people want everything for free.
@subhajitdey135
@subhajitdey135 2 ай бұрын
One question : How to think of the range intuition u wrote ? I tried to solve by taking the maximal value of arr[i], as the question asks minimum number of jumps, so I thought that the arr[i] values should be maximum to get the minimum jumps. Btw thanks Striver for uploading Greedy playlist !!
@jotsinghbindra8317
@jotsinghbindra8317 6 ай бұрын
sir please fix the saved notes issue of striver sheet after the new update i am facing a problem that notes saved for question A gets saved to notes of question B(happens when you restart the website and go to saved notes navbar section to check your notes)
@cswaale4498
@cswaale4498 6 ай бұрын
Hey raj, can you bring the string series soon???
@monicaaahaha
@monicaaahaha 20 күн бұрын
basically you should give disclaimer that please watch DP series before this - (or create a separate playlist which include all the questions which needs to covered after covering all concepts) - idk what m saying
@Soum1947
@Soum1947 2 ай бұрын
for ppl who are watching first time, there is a error in the title.. dynamic programming soln, not greedy soln
@aniketbansod8136
@aniketbansod8136 6 ай бұрын
Bhaiyya, please start heap series after this one
@deepanshuchaudhary9299
@deepanshuchaudhary9299 6 ай бұрын
Bhaiya please make a series on strings badly need it it's a humble request
@MAX_RITIK
@MAX_RITIK 6 ай бұрын
love your tutorials till now can you pls add string series also
@ashian09
@ashian09 Ай бұрын
Why here we need to take minimum as we can only return jump at the if we reached to the index which is => n-1 by using void function because at same level jump value would be the same why to take minimum of all...anyone?
@iamnoob7593
@iamnoob7593 5 ай бұрын
Striver brilliant solution man , I had done this problem using dp only , No wonder u r in GOOGLE
@UECAshutoshKumar
@UECAshutoshKumar 2 ай бұрын
Thank you
@aeshwer
@aeshwer 6 ай бұрын
awesome content... please make string playlist soon
@apmotivationakashparmar722
@apmotivationakashparmar722 Ай бұрын
Thank you so much bhaiya
@Flash-qr5oh
@Flash-qr5oh 5 ай бұрын
HOW IS IT 2 JUMPS FOR ALL INDEXES FROM F(1,1) IN TREE @3:09 ?
@AlokTripathi
@AlokTripathi 4 ай бұрын
it's wrong computation.
@prerakunhale50
@prerakunhale50 6 ай бұрын
please bring the string video first .A humble request from us
@shwetanshu13
@shwetanshu13 6 ай бұрын
Thank u so much for this playlist
@MayankPareek
@MayankPareek 6 ай бұрын
Bhaiya pattern wise recursion prr bhi daal do
@deepanshu7295
@deepanshu7295 6 ай бұрын
Bhaiya please start sde sheet challange 2024
@satyadev_k
@satyadev_k 2 ай бұрын
int minimumJumps(vector& arr, int n) { int l = 0; int r = 0; int farthest = 0; int cnt = 0; while (r < n - 1) { for (int i = l; i
@the_random_youtuber12
@the_random_youtuber12 2 ай бұрын
Is Recursion playlist completed?
@bbkivine3790
@bbkivine3790 Ай бұрын
ye dynamic programming hogya na
@shresthjain7557
@shresthjain7557 4 ай бұрын
Wow ! what a solution
@DeadPoolx1712
@DeadPoolx1712 Ай бұрын
UNDERSTOOD;
@chiragsharma8905
@chiragsharma8905 5 ай бұрын
Striver, there is no need for 2D DP here. It can be solved using 1D DP.
@Rahul-jy9wg
@Rahul-jy9wg 2 ай бұрын
word of advice, interviewer should not expect this solution from you because this is not at all intuitive unless you have solved this question in the past, this does not mean you should not give this solution in the interview, but most probably interview might already know that you have already solved this question.
@hajeeramohamad7641
@hajeeramohamad7641 5 ай бұрын
Isn't that i+arr[i] inside the for loop? Why striver has written i+arr[ind]? Won't that be different?
@thoughtsofkrishna8963
@thoughtsofkrishna8963 4 ай бұрын
Waiting for strings playlist
@ShivamDangwal-n1o
@ShivamDangwal-n1o 4 ай бұрын
Understood 💯
@abhinay.k
@abhinay.k 2 ай бұрын
thank you sir
@sagarsm23
@sagarsm23 6 ай бұрын
Why code studio is gone
@prateek4279
@prateek4279 5 ай бұрын
was the greedy solution intuitive or not ?coz i dont find it intuitive!!!!
@devanshshroff1820
@devanshshroff1820 6 ай бұрын
Started your playlist a week ago, didn't know there are more videos in the making. What else is remaining in the course?
@brainmosquito7
@brainmosquito7 4 ай бұрын
all major portions are covered strings is just remaining i recommend you to go to TUF wesite and start following A2Z sheet
@StudyYuv
@StudyYuv 4 ай бұрын
got it bro!!!
@sandeepxt99
@sandeepxt99 6 ай бұрын
you are best❤
@KKKK-pl8yf
@KKKK-pl8yf 6 ай бұрын
Thanks Great Content!
@samitkumar18
@samitkumar18 6 ай бұрын
String please
@SibiRanganathL
@SibiRanganathL 2 ай бұрын
Understood :)))
@sujalsinha240
@sujalsinha240 4 ай бұрын
Please bring heaps bro
@subee128
@subee128 3 ай бұрын
Thanks
@NitinSharma-bk7dw
@NitinSharma-bk7dw 5 ай бұрын
There can one more simple greedy solution #Java class Solution { public int jump(int[] nums) { int z; int smallest[]=new int[nums.length]; smallest[nums.length-1]=0; for(int i=nums.length-2;i>=0;i--){ if(i+nums[i]>=nums.length-1) smallest[i]=1; else{ z=getsmallest(smallest, i+1, i+nums[i]); smallest[i]=1+z; } } return smallest[0]; } int getsmallest(int ary[], int a, int b){ int small=10000000; for(int j=a;j
@worldfromhome4033
@worldfromhome4033 4 ай бұрын
Best!
@ayushgaurabh8604
@ayushgaurabh8604 5 ай бұрын
awesome
@atharv1002
@atharv1002 2 ай бұрын
need strings lessonsssss
@Ybash2979
@Ybash2979 5 ай бұрын
brother ye toh DP ka question hai then put it there why in greedy playlist :)
@Rahul_Mongia
@Rahul_Mongia 5 ай бұрын
question has different ways to solve, this soln has greedy as optimal approach
@tanujaSangwan
@tanujaSangwan 2 ай бұрын
This is also a graph question. If you carefully see this problem of finding the minimum number of jumps in an array can be represented as a directed, unit-weight graph, BFS (Breadth-First Search) is an appropriate and efficient method to find the shortest path.
@parvahuja7618
@parvahuja7618 6 ай бұрын
thankyou sir
@hautran7559
@hautran7559 6 ай бұрын
love it
@Professor-du2pf
@Professor-du2pf 5 ай бұрын
Understood
@aakashjha8393
@aakashjha8393 3 ай бұрын
Why is R always L+1?
@naviyas2305
@naviyas2305 Ай бұрын
am not able to understand
@AbhishekKumar-td5zu
@AbhishekKumar-td5zu 25 күн бұрын
❤❤❤❤❤
@ManishKumar-dk8hl
@ManishKumar-dk8hl 6 ай бұрын
yehi too chahiye tha 😭
@ANONYMOUS-xj1kd
@ANONYMOUS-xj1kd 5 ай бұрын
hey striver here in my O(n) time complexity solution int jump(vector& nums) { int final=nums.size()-1; int i=0; int count=0; while(final!=0){ if(nums[i]>=final-i){ final=i; count++; i=0; } else i++; } return count; }
@KartikeyTT
@KartikeyTT 5 ай бұрын
ty sir
@084abhigna_y8
@084abhigna_y8 6 ай бұрын
Data Structures & Algorithm ❌ Data STRIVERS & Algorithm ✅
@surbhigupta5777
@surbhigupta5777 5 ай бұрын
US
@firebout7675
@firebout7675 2 ай бұрын
us
@prateek4279
@prateek4279 5 ай бұрын
the dp solution is 1d why use 2d:class Solution { public: int solve(vector& nums,int id,vector& dp){ if(id>=nums.size()-1)return 0; if(dp[id]!=-1)return dp[id]; int reach=id+nums[id]; int n=nums.size(); int mini=1e9; for(int k=id+1;k
@aggarwalsachin4854
@aggarwalsachin4854 5 ай бұрын
bro, why is your voice very low in this greedy series, can't here u properly
@aryankumar3018
@aryankumar3018 3 ай бұрын
Understood
L6. Job Sequencing Problem | Greedy Algorithm Playlist
16:07
take U forward
Рет қаралды 51 М.
L4. Jump Game - I | Greedy Algorithm Playlist
10:53
take U forward
Рет қаралды 60 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 111 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 88 МЛН
L12. Minimum Window Substring | 2 Pointers and Sliding Window Playlist
27:06
Next Permutation | GFG POTD 19 Nov 2024 | JAVA | C++
13:29
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 197 М.
L11. Valid Parenthesis String | Multiple Approaches
26:09
take U forward
Рет қаралды 46 М.
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
Merge Sorted Arrays Without Extra Space | 2 Optimal Solution
32:47
take U forward
Рет қаралды 215 М.
Quick Sort For Beginners | Strivers A2Z DSA Course
35:17
take U forward
Рет қаралды 454 М.
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 12 МЛН