Leetcode 1696. Jump Game VI [Monotone Queue]

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • Monotone Stack :- • Monotone Stack (Leetco...
    Leetcode 1696. Jump Game VI
    Problem Link -leetcode.com/c...
    Jump Game V
    • Leetcode 1340. Jump Ga...

КОМЕНТАРІ • 24

  • @vinayakbajpeyi931
    @vinayakbajpeyi931 2 роки тому +3

    This was great! Loved how you made it seem so easy

  • @piyushrajput0_
    @piyushrajput0_ 2 роки тому +2

    Aisa lga solution dekh kar chep diya

  • @priyanshagarwal2095
    @priyanshagarwal2095 3 роки тому +1

    we can also use multiset or set pairs for monotone queue

  • @namithas6546
    @namithas6546 3 роки тому +5

    Thank you for the clear explanation.

  • @ITwithIT
    @ITwithIT 3 роки тому

    For solution in java, check this video!
    ua-cam.com/video/zYOGwEl_F-w/v-deo.html

  • @himanshuchhikara4918
    @himanshuchhikara4918 3 роки тому +3

    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

    • @mohammadfraz
      @mohammadfraz  3 роки тому

      Thanks a lot bro , I will keep it in mind from the very next lecture.

  • @niharikaepuri3305
    @niharikaepuri3305 2 роки тому

    In 15:01, In line 16 of code shouldnt we insert at front of the queue?

    • @ingentisdeus1245
      @ingentisdeus1245 2 роки тому

      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.

  • @soneshengg
    @soneshengg 3 роки тому +1

    Thank you, awesome

  • @saunaknandi1814
    @saunaknandi1814 2 роки тому

    Why u take everything from backward, this make the approach little bit complicated

  • @neha-fp6kp
    @neha-fp6kp 3 роки тому +1

    why will a simple memoization not work for this?

  • @MGtvMusic
    @MGtvMusic 3 роки тому +1

    Can't we use a Max heap for this?

    • @codestorywithMIK
      @codestorywithMIK 3 роки тому +1

      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

    • @MGtvMusic
      @MGtvMusic 3 роки тому

      @@codestorywithMIK Yes I did that haha Thank you !

    • @vikneshcs4824
      @vikneshcs4824 Місяць тому +1

      Here time complexity would be nlogk

  • @Mandeepsingh-jo5cf
    @Mandeepsingh-jo5cf 3 роки тому +1

    Thanks bro.

    • @mohammadfraz
      @mohammadfraz  3 роки тому +1

      Welcome, please share it with your friends

  • @rajatjoshi4069
    @rajatjoshi4069 2 роки тому

    Thank You Bhaiya

  • @shubhayanb51
    @shubhayanb51 2 роки тому

    You'll find better explainations of this video online. This was very confusing