amazing bro and do more focus in explanation part(you do usually most of the time but sometime i personally felt you move quickly to coding part ) as you have done in this video so that java user can also take advantage of ur wonderfull channel
Adding from the back of the queue by popping all elements smaller than current element. So it ensures if an element exists in front of the recently added element, it is either greater than or equal to it.
Yes. You can mimic the same with priority queue what we are trying to do using monotonic queue here. Code Link (Approach-4) : github.com/MAZHARMIK/Interview_DS_Algo/blob/master/DP/Jump%20Game%20VI.cpp
This was great! Loved how you made it seem so easy
Aisa lga solution dekh kar chep diya
we can also use multiset or set pairs for monotone queue
Thank you for the clear explanation.
For solution in java, check this video!
ua-cam.com/video/zYOGwEl_F-w/v-deo.html
amazing bro and do more focus in explanation part(you do usually most of the time but sometime i personally felt you move quickly to coding part ) as you have done in this video so that java user can also take advantage of ur wonderfull channel
Thanks a lot bro , I will keep it in mind from the very next lecture.
In 15:01, In line 16 of code shouldnt we insert at front of the queue?
Adding from the back of the queue by popping all elements smaller than current element. So it ensures if an element exists in front of the recently added element, it is either greater than or equal to it.
Thank you, awesome
Why u take everything from backward, this make the approach little bit complicated
why will a simple memoization not work for this?
O(n*k) complexity will so tle
it will be n*k which leads to TLE i.e 10^10
Can't we use a Max heap for this?
Yes. You can mimic the same with priority queue what we are trying to do using monotonic queue here.
Code Link (Approach-4) : github.com/MAZHARMIK/Interview_DS_Algo/blob/master/DP/Jump%20Game%20VI.cpp
@@codestorywithMIK Yes I did that haha Thank you !
Here time complexity would be nlogk
Thanks bro.
Welcome, please share it with your friends
Thank You Bhaiya
You'll find better explainations of this video online. This was very confusing