Minimum jumps to reach end of array (Dynamic Programming)
We find minimum jumps to reach end of array. This is a dynamic programming problem.
Жүктеу.....
Пікірлер: 176
@vibhashreems5263 жыл бұрын
Watched everybody's explanation whole day I searched but I finally understood yours
@AlokGuptakumar6 жыл бұрын
u really patiently explain all solutions...thanks
@siddharthkhandelwal9335 жыл бұрын
U actually teach very well.and that clearly explains that u have the feel of DP
@nickharalampopoulos4 жыл бұрын
This is the most thorough explanation I have seen. Thank you.
@mdalishanali39092 жыл бұрын
I was struggling a lot with this problem. Thank you for explaining so thoroughly.It is helpful after 100 years also..
@historybrow98504 жыл бұрын
i am always so happy, whenever i search for a problem and u have a solution, u give the best explanations
@rajashribanerjee69342 жыл бұрын
I was struggling a lot with this problem. Thank you for explaining so thoroughly.
@vaibhavimandloi69532 жыл бұрын
I was stucked at this problem for a whole day but now I got it completely .Thankyou!!
@rajitsrajan26443 жыл бұрын
Your channel is great. Please continue uploading videos. Your presentation and way of teaching is amazing. Keep up the good work.
@devanshsharma57044 жыл бұрын
The best explanation for the problem , huge respect sir
@cedong64126 жыл бұрын
Really love your video for this topic! I think you are the only one who teaches step by step and I totally understand DP solution for this problem, thanks for your efforts and wish all the best:)
@mahakgupta51654 жыл бұрын
This same question was asked in Goldman Sachs internship written paper. At that i was unable to solve ,but now i can. Thank you.
@natesh16 жыл бұрын
In ur videos pls consider to mention the time and space complexity also. Helps greatly to judge the method.
@gaurav19may
6 жыл бұрын
Agreed. Otherwise, they are excellent. Thank you.
@DSA_Coding
3 жыл бұрын
o(n^2)
@sandeshdalvi3781
3 жыл бұрын
Yes , exactly
@captainamerica29923 жыл бұрын
i watched a 1000 videos on this question and this video just explained it so easily , thanks
@adarshgupta43825 жыл бұрын
You are indeed the best teacher for algorithm .
@shivamshrivastava50194 жыл бұрын
sir you expalain too good ...i was searching for the channel like yours for two week, finally i got your channel ....SUBSCRIBED SIR
@satanlucifer44373 жыл бұрын
Something about your explanation really clicked we me. Since we haven't learned the technique of using infinity in my class, I instead used None and added a couple if statements :)
@alpeshnakarani5 жыл бұрын
Super Detailed explanation. Really helpful.
@kdroadie5 жыл бұрын
my dynamic programming grip is now awesome,,thanks to u sir
@ragingpahadi4 жыл бұрын
Your explanation are detailed ad very very easy to understand keep up the good work buddy !
@bijayamanandhar3890 Жыл бұрын
I want to work as a data scientist or machine learning engineer, and preparing for job interview. Your videos help me a lot, however 'Graph' is new to me.
@vikashkumarchaurasia12995 жыл бұрын
best explaination i have ever seen for this problem , thanks a lot !!!
@shubhadityamaljonia66133 жыл бұрын
Really a good explanatory video but it would be more better if you put a link of the code explained in the video, as it would be difficult for us to find code of such beautifully explained algorithm. Thanks Again...
@sarfarazalam60774 жыл бұрын
You made my day!! Thank you great explanation. Video answered all my doubts. It would be more useful , if you could give intuition to problem.
@adityapandey97583 жыл бұрын
sir aapka code itna simple aur chota tha...aur mene code likhne me 2 din laga diya phir bhi solution nahi nikala....phir aapka code dekha...aur bht hasi aayi itne simple code ke liye me najane kya kya kr raha tha😂😂
@ranjanrohit645 жыл бұрын
THANKS FOR SUCH A BEAUTIFUL VIDEO SIR. I GOT IT FULLY...A BIG THANKS
@narayananrenganathan7655 жыл бұрын
Please add videos for different sorting algorithms. Thanks in Advance. Great work. Keep going !!
@EternalDharma016 жыл бұрын
One minute was enough to make a comment about the video. Loved it.
@pranybany4 жыл бұрын
Thanks Vivekanand Khyade you rock as always.
@teetanrobotics53635 жыл бұрын
Can you please order the dynamic programming playlist ?
@niveditakatakam6 жыл бұрын
To reduce the number of iterations, I think we can directly start index j from jump_path_arr[i-1] and check if i is reachable and increment j from there.
@laraibanwar16184 жыл бұрын
Sir please put up more videos on dp It was very helpful. Ur way of explanation is very good I was able to solve codeforces problems related to dp Plz sir
@keerthanamahalingam4743 жыл бұрын
Hats off to your explanation sir great video sir
@JustSkillGG5 жыл бұрын
I would add a "break;" command after the if {..} Excelent work.. Thank you sir! This channel will definetely blow up someday
@sourabhahuja6 жыл бұрын
Awesome Vivek!!! Great Videos. Thank you very much :-)
@tan55534 жыл бұрын
Could you please xplain the problems in cracking coding interview book... The way you xplain is easily understandable.
@bharadwajachepuri9686 жыл бұрын
Hi Sir can you please explain the grid formation of Egg Dropping Problem and longest ariyhmetic sequence in DP
@aaokhelen3 жыл бұрын
greatest tutorial i've ever seen. Keep it up
@bhanuarora45043 жыл бұрын
Really nice explaination for a beginner like me,thanks sir
@anmolkumarshah3 жыл бұрын
very good explanation .. really liked your way of teaching i hit the bell icon now
@hrithikjaiswal40403 жыл бұрын
Great One ! Excellent dry run..
@raj-nq8ke2 жыл бұрын
As usual always the best explanation.
@manasranjan43 жыл бұрын
Good Explanation. Kudos Really you appreciate
@anirudhdevpura27983 жыл бұрын
very good and thorough explanantion. Keep it up sir. But just try to explain complete code also along with explanation
@shyamnwade4 жыл бұрын
Excellent way of explaining algorithm
@sajeelkhan45002 жыл бұрын
brilliantly explained sir
@aditikhandelwal1353 жыл бұрын
Amazing!! after so many videos this is best
@RANJANJHA956 жыл бұрын
Please help if you can design some optimised algorithm for below problem statement. You have synonyms for words stored in dictionary/map like HashMap synonyms = new HashMap() synonyms.put(“tree”, “tree1") synonyms.put(“far tree”, “tree2") You have to replace the word present in input string with the value corresponding to the key present in the map. Input: I saw a far tree near the old tree Output: I saw a tree2 near the old tree1
@AllTypeShorts..3 жыл бұрын
Sir, I was struggling for understanding this problem. I even tried 3-4 video lectures of different people but still I can't get it. But the way you explained this problem hit directly in my brain and finally I find it very easy. Many Many thanks for your explanation and efforts. God bless you always.
@pratikpatrimath4887
2 жыл бұрын
same here bro😄
@veganengineer20193 жыл бұрын
excellent explanation. very thorough
@mybabyharshu4 жыл бұрын
great explained .. when you assigning jump path array ?
@ayaramzy68153 жыл бұрын
I love yr videos u are the best ... please explain palindrome partitioning
@nitinnanda18655 жыл бұрын
does it work for arr[0, 1, 1, 1, 1]
@bhaskyOld5 жыл бұрын
Any solution with O(n)?
@piyushrathi97713 жыл бұрын
Can you explain how the algorithm will take care of the array [0,1,1,1,1]???
@ir0nt0ad6 жыл бұрын
thanks a lot! could you please do Kruskal's MST at some point?
@surya00726 жыл бұрын
superb !! any real time situations where we use this logic ?
@VIJENDRASINGH-zg2lp3 жыл бұрын
Best explanation. Thank you!
@yashnistane67283 жыл бұрын
Very beautifully explained!!!
@ashwanisharma89032 жыл бұрын
Thanks sir. You just made complex algo like kids game. Thanks a ton.
@ankitsinha90194 жыл бұрын
Awesome explanation...sir
@therohanjaiswal3 жыл бұрын
the best explanation for this problem
@ashishupadhyay68813 жыл бұрын
A few changes to make it O(n) instead of O(n^2) :) jump(vector &a) { int n=a.size(); if(n
@subhashmallick
3 жыл бұрын
Also you could have done early return whenever dp[j] is filled where j has reached n-1.
@tarungopal30654 жыл бұрын
Can you please make a video on " Count of subarrays whose sum is a perfect square".
@namanvijay35143 жыл бұрын
Best explanation 👍
@dhirendrakumar46195 жыл бұрын
Very Good explanation Sir thanks
@harshpanwar15503 жыл бұрын
Thank u so much sir!!! This really helped a lot...
@RahulKumar-lb9nk6 жыл бұрын
Your videos are very interesting .. It would be great if could segregate your content based on context and post as modules
@hirakmondal61743 жыл бұрын
Great video, but one point to note is that it will fail for some corner cases like--> arr[]={0,1,1,1,1}. This doesn't has any solution
@anujdeep37965 жыл бұрын
thank you sir for the wonderful video.
@lueizack66393 жыл бұрын
superb explanation
@abcd12359114 жыл бұрын
This is an O(n^2) solution. Do you have O(n) solution?
@ANANDJULU5 жыл бұрын
awesome explanation!
@user-lb1fl7sh8m6 жыл бұрын
You are a boss keep the good work
@yogeshkolpe26015 жыл бұрын
awesome explanation !!!
@svdfxd5 жыл бұрын
Another excellent video.
@sukritkapil98164 жыл бұрын
thanks for detailed explanation!
@madhusudanankaskar39895 жыл бұрын
Sir kindly make a video on Buying and selling of shares using k transactions. I am not able to understand the concept.
@utsavkaranjit29113 жыл бұрын
Amazing Explanation to the solution. But looks like this solution is too slow. How can we improve the time complexity?
@priyanshukhullar58364 жыл бұрын
Jordaar Uncle :)
@sakthisri56256 жыл бұрын
Can u pls upload a video on minimum initial points to reach destination
@anubhavnema6133 жыл бұрын
Too good explanation
@ashishjangir883 жыл бұрын
Another Solution in just O(n) and Easy to Understand: int minJumps(int arr[], int n){ // Your code here if(arr[0] == 0) return -1; else if(n == 1) return 0; int dest = 0, pos = 0, jumps = 0; for(int i=0; i
@Rafi-nc3nw
2 жыл бұрын
Thank you very much!!! Such a mind blowing and easy concept.
@PrafulPrasad4 жыл бұрын
Super awesome explanation. The answer to the problem is explained on geeksforgeeks.org but I never understood it even after trying to debug the code multiple time. This is a lengthy video but it was well worth my time understood it in an instant. The only problem is its not the most optimal solution even in DP :(
@sushmitamandal9423 жыл бұрын
amazing explanation
@priyankajhamb70612 жыл бұрын
Nice explanation
@AshishKumar-to7gy4 жыл бұрын
nice explanation..
@rahulchaubey89884 жыл бұрын
Nicely explained...
@riitviksharma59322 жыл бұрын
Best explanation
@sonurathod95512 жыл бұрын
This code fail in [2,1,0,3] need help?
@vikasmishra11904 жыл бұрын
Jump= -1; Sum=0; While (sum=n){ jump++; } cout
@DSA_Coding3 жыл бұрын
I really enjoyed your way of teaching ,
@vivekanandkhyade
3 жыл бұрын
Thank you! 😃
@AbhishekKumar-wc2he4 жыл бұрын
sir please make some videos on question asked on heaps
@yidonghuang32804 жыл бұрын
He is a amazing teacher(from a leaner in China)
@Aryansingh-fk7hy
3 жыл бұрын
CCP has blocked KZread in china!,you use VPN or live in india istead?
@yidonghuang3280
3 жыл бұрын
@@Aryansingh-fk7hy I'm living US
@Aryansingh-fk7hy
3 жыл бұрын
@@yidonghuang3280 fortunate you are!!.
@tanushreeyadav7454 жыл бұрын
plz can u upload word break dp question solution
@coder_ishwar_kumar2 жыл бұрын
Can u pls solve this in O(N) TC ans O(1)SC .. thx fr the great video ... even though i know the solution i always come to ur channel to watch the solution bcoz ur explanations are great..
@BhaiyaDesi4 жыл бұрын
The algorithm could fail in many uncommon scenarios like {1, 0, 3, 5}. Algorithm explained is pretty straightforward , but it lacks accommodating few exceptional cases.
@Mei-ir3ml6 жыл бұрын
Superb!!!
@ishan_kumar5 жыл бұрын
One more check is required in if condition. Awesome explanation though. Kudos! if( i
Пікірлер: 176
Watched everybody's explanation whole day I searched but I finally understood yours
u really patiently explain all solutions...thanks
U actually teach very well.and that clearly explains that u have the feel of DP
This is the most thorough explanation I have seen. Thank you.
I was struggling a lot with this problem. Thank you for explaining so thoroughly.It is helpful after 100 years also..
i am always so happy, whenever i search for a problem and u have a solution, u give the best explanations
I was struggling a lot with this problem. Thank you for explaining so thoroughly.
I was stucked at this problem for a whole day but now I got it completely .Thankyou!!
Your channel is great. Please continue uploading videos. Your presentation and way of teaching is amazing. Keep up the good work.
The best explanation for the problem , huge respect sir
Really love your video for this topic! I think you are the only one who teaches step by step and I totally understand DP solution for this problem, thanks for your efforts and wish all the best:)
This same question was asked in Goldman Sachs internship written paper. At that i was unable to solve ,but now i can. Thank you.
In ur videos pls consider to mention the time and space complexity also. Helps greatly to judge the method.
@gaurav19may
6 жыл бұрын
Agreed. Otherwise, they are excellent. Thank you.
@DSA_Coding
3 жыл бұрын
o(n^2)
@sandeshdalvi3781
3 жыл бұрын
Yes , exactly
i watched a 1000 videos on this question and this video just explained it so easily , thanks
You are indeed the best teacher for algorithm .
sir you expalain too good ...i was searching for the channel like yours for two week, finally i got your channel ....SUBSCRIBED SIR
Something about your explanation really clicked we me. Since we haven't learned the technique of using infinity in my class, I instead used None and added a couple if statements :)
Super Detailed explanation. Really helpful.
my dynamic programming grip is now awesome,,thanks to u sir
Your explanation are detailed ad very very easy to understand keep up the good work buddy !
I want to work as a data scientist or machine learning engineer, and preparing for job interview. Your videos help me a lot, however 'Graph' is new to me.
best explaination i have ever seen for this problem , thanks a lot !!!
Really a good explanatory video but it would be more better if you put a link of the code explained in the video, as it would be difficult for us to find code of such beautifully explained algorithm. Thanks Again...
You made my day!! Thank you great explanation. Video answered all my doubts. It would be more useful , if you could give intuition to problem.
sir aapka code itna simple aur chota tha...aur mene code likhne me 2 din laga diya phir bhi solution nahi nikala....phir aapka code dekha...aur bht hasi aayi itne simple code ke liye me najane kya kya kr raha tha😂😂
THANKS FOR SUCH A BEAUTIFUL VIDEO SIR. I GOT IT FULLY...A BIG THANKS
Please add videos for different sorting algorithms. Thanks in Advance. Great work. Keep going !!
One minute was enough to make a comment about the video. Loved it.
Thanks Vivekanand Khyade you rock as always.
Can you please order the dynamic programming playlist ?
To reduce the number of iterations, I think we can directly start index j from jump_path_arr[i-1] and check if i is reachable and increment j from there.
Sir please put up more videos on dp It was very helpful. Ur way of explanation is very good I was able to solve codeforces problems related to dp Plz sir
Hats off to your explanation sir great video sir
I would add a "break;" command after the if {..} Excelent work.. Thank you sir! This channel will definetely blow up someday
Awesome Vivek!!! Great Videos. Thank you very much :-)
Could you please xplain the problems in cracking coding interview book... The way you xplain is easily understandable.
Hi Sir can you please explain the grid formation of Egg Dropping Problem and longest ariyhmetic sequence in DP
greatest tutorial i've ever seen. Keep it up
Really nice explaination for a beginner like me,thanks sir
very good explanation .. really liked your way of teaching i hit the bell icon now
Great One ! Excellent dry run..
As usual always the best explanation.
Good Explanation. Kudos Really you appreciate
very good and thorough explanantion. Keep it up sir. But just try to explain complete code also along with explanation
Excellent way of explaining algorithm
brilliantly explained sir
Amazing!! after so many videos this is best
Please help if you can design some optimised algorithm for below problem statement. You have synonyms for words stored in dictionary/map like HashMap synonyms = new HashMap() synonyms.put(“tree”, “tree1") synonyms.put(“far tree”, “tree2") You have to replace the word present in input string with the value corresponding to the key present in the map. Input: I saw a far tree near the old tree Output: I saw a tree2 near the old tree1
Sir, I was struggling for understanding this problem. I even tried 3-4 video lectures of different people but still I can't get it. But the way you explained this problem hit directly in my brain and finally I find it very easy. Many Many thanks for your explanation and efforts. God bless you always.
@pratikpatrimath4887
2 жыл бұрын
same here bro😄
excellent explanation. very thorough
great explained .. when you assigning jump path array ?
I love yr videos u are the best ... please explain palindrome partitioning
does it work for arr[0, 1, 1, 1, 1]
Any solution with O(n)?
Can you explain how the algorithm will take care of the array [0,1,1,1,1]???
thanks a lot! could you please do Kruskal's MST at some point?
superb !! any real time situations where we use this logic ?
Best explanation. Thank you!
Very beautifully explained!!!
Thanks sir. You just made complex algo like kids game. Thanks a ton.
Awesome explanation...sir
the best explanation for this problem
A few changes to make it O(n) instead of O(n^2) :) jump(vector &a) { int n=a.size(); if(n
@subhashmallick
3 жыл бұрын
Also you could have done early return whenever dp[j] is filled where j has reached n-1.
Can you please make a video on " Count of subarrays whose sum is a perfect square".
Best explanation 👍
Very Good explanation Sir thanks
Thank u so much sir!!! This really helped a lot...
Your videos are very interesting .. It would be great if could segregate your content based on context and post as modules
Great video, but one point to note is that it will fail for some corner cases like--> arr[]={0,1,1,1,1}. This doesn't has any solution
thank you sir for the wonderful video.
superb explanation
This is an O(n^2) solution. Do you have O(n) solution?
awesome explanation!
You are a boss keep the good work
awesome explanation !!!
Another excellent video.
thanks for detailed explanation!
Sir kindly make a video on Buying and selling of shares using k transactions. I am not able to understand the concept.
Amazing Explanation to the solution. But looks like this solution is too slow. How can we improve the time complexity?
Jordaar Uncle :)
Can u pls upload a video on minimum initial points to reach destination
Too good explanation
Another Solution in just O(n) and Easy to Understand: int minJumps(int arr[], int n){ // Your code here if(arr[0] == 0) return -1; else if(n == 1) return 0; int dest = 0, pos = 0, jumps = 0; for(int i=0; i
@Rafi-nc3nw
2 жыл бұрын
Thank you very much!!! Such a mind blowing and easy concept.
Super awesome explanation. The answer to the problem is explained on geeksforgeeks.org but I never understood it even after trying to debug the code multiple time. This is a lengthy video but it was well worth my time understood it in an instant. The only problem is its not the most optimal solution even in DP :(
amazing explanation
Nice explanation
nice explanation..
Nicely explained...
Best explanation
This code fail in [2,1,0,3] need help?
Jump= -1; Sum=0; While (sum=n){ jump++; } cout
I really enjoyed your way of teaching ,
@vivekanandkhyade
3 жыл бұрын
Thank you! 😃
sir please make some videos on question asked on heaps
He is a amazing teacher(from a leaner in China)
@Aryansingh-fk7hy
3 жыл бұрын
CCP has blocked KZread in china!,you use VPN or live in india istead?
@yidonghuang3280
3 жыл бұрын
@@Aryansingh-fk7hy I'm living US
@Aryansingh-fk7hy
3 жыл бұрын
@@yidonghuang3280 fortunate you are!!.
plz can u upload word break dp question solution
Can u pls solve this in O(N) TC ans O(1)SC .. thx fr the great video ... even though i know the solution i always come to ur channel to watch the solution bcoz ur explanations are great..
The algorithm could fail in many uncommon scenarios like {1, 0, 3, 5}. Algorithm explained is pretty straightforward , but it lacks accommodating few exceptional cases.
Superb!!!
One more check is required in if condition. Awesome explanation though. Kudos! if( i
nice explaination