514. Freedom Trail | DP | Dijkstras | Google | Top-Down | Bottom-Up | Bottom-Up Optimized

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • In this video, I'll talk about how to solve Leetcode 514. Freedom Trail | DP | Dijkstras | Google | Top-Down | Bottom-Up | Bottom-Up Optimized
    Let's Connect:
    📱Discord (Join Community) : / discord
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / ez.pz.dsa
    💻 Twitter - / aryan_mittal007
    🤖 Github: github.com/ary...
    About Me:
    I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Komentáře • 31

  • @ARYANMITTAL
    @ARYANMITTAL  Před 4 měsíci +17

    Sorry, a lot of things happened in today's video & a lot of people came in frame too🥲🥹

    • @nothingmuch140
      @nothingmuch140 Před 4 měsíci +3

      NO PROBLEM BRO✨✨

    • @shivamdashore6864
      @shivamdashore6864 Před 4 měsíci +1

      The wait is over. Thanks, bro!

    • @prashant1049-y4h
      @prashant1049-y4h Před 4 měsíci

      The behavior you exhibited is not acceptable. Please be careful to avoid repeating it in the future.

    • @johnj171
      @johnj171 Před měsícem

      @@prashant1049-y4h lamo 😂😂

    • @johnj171
      @johnj171 Před měsícem

      hy thanks for explaining Great job

  • @jatishay26
    @jatishay26 Před 4 měsíci

    Amazing video. Keep it up

  • @aditimahabole1761
    @aditimahabole1761 Před 4 měsíci +6

    bro how do you get time , like are you working in company also ? or you are dedicating you time to videos only ... just asking for time management.

  • @tasneemayham974
    @tasneemayham974 Před 4 měsíci

    AMAZZINNNGGGG!!! The vid was 48 minutes. But I spent 3 hours analyzing and taking notes!! Thank you Aryan, bro!!

  • @aniketsinha101
    @aniketsinha101 Před 4 měsíci +2

    Thanks for making complicated problem more complicated then it seems.
    I mean i always suggest, not to get spooked by hard problem.
    First will be not to think dynamic programming for hard problem,
    Start with recursion, then memoize, and then tabulate.
    Its fine, if you are getting TLE, or its below average solution.
    Build a recursive solution
    -> if the index is greater than key, we return 0
    your helper function will look like this (String ring, String key, int pointer, int index)
    index will be used for traversal for the next character in the key.
    pointer indicates the current location in the ring string
    assume step to be maximum.
    we will put a for loop to traverse the ring. (i to ring size)
    If the ring index is equal to key index,
    then steps will be minimum of steps or,
    abs(i-ptr),
    or n- abs(i-ptr)+1+ call the recursion with pointer,index +1.
    return steps at the end
    at the end just create a dp, add two line code to memoize it

  • @nikhilkumarpradhan4276
    @nikhilkumarpradhan4276 Před 4 měsíci +1

    Dijkstras👏👏👏👏Thankuu bhaiya

  • @rm0ndo
    @rm0ndo Před 3 měsíci

    Quick note if you're doing the space optimized version and using Java... change prevDp = curDp to prevDp = curDp.clone()

  • @akshaysoni5223
    @akshaysoni5223 Před 4 měsíci

    Great Explanation 👍

  • @sanskardhyani4112
    @sanskardhyani4112 Před 4 měsíci

    awesome video bhaiya

  • @Anonymous____________A721
    @Anonymous____________A721 Před 4 měsíci +1

    Oh my god
    Thanks

  • @tanyaraj3129
    @tanyaraj3129 Před 4 měsíci +2

    maksad nahi bhulna was something personal to say

  • @adityamehta543
    @adityamehta543 Před 4 měsíci

    bro, please add the code solution in the description as well

  • @IndaramKumawat-sr2mk
    @IndaramKumawat-sr2mk Před 4 měsíci

    why did the greedy will not work well in this problem please will you explain it

  • @ajayc815
    @ajayc815 Před 4 měsíci

    Understood

  • @chetan.s.bandurkar2690
    @chetan.s.bandurkar2690 Před 4 měsíci

    aj ke biweekly ke problem ke solution upload krna bhaiya 27-04-24 vale eke,,3rd and 4th specialy

  • @satwiktatikonda764
    @satwiktatikonda764 Před 4 měsíci

    thanks for explaining wch loop comes first ...we usually write state1 in memo as loop1 and state2 as loop 2
    but here its not the case

  • @shivchauhan795
    @shivchauhan795 Před 4 měsíci

    Hi, mujhe dp vaale question bohot jada mushkil lg rhe hain. Baaki questions trees, graph isse bohot easy lgte hain but dp hi nhi samajh aati. Aryan, can you help me tell me how can I overcome this. Please reply.

    • @gyanendrasingh6822
      @gyanendrasingh6822 Před 4 měsíci

      practice more recursion problem so you will be easily understanding dp.

  • @aastikofficial6100
    @aastikofficial6100 Před 4 měsíci +3

    Bro dont go for longer videos for watch time you can simply explain it bhai tum over kr dete ho complicated ko or complicated kr dete ho agr simply smghaoge jyada confuse nhi kroge to apne aap views aayenge tum hr video ko lamba kichte ho or complicated krte rhte ho ig i am right if not correct me here

    • @VishalKumar-lw3yh
      @VishalKumar-lw3yh Před 4 měsíci +3

      go and watch solution which is 15 min long and dry run on a example then code it and u rote it.
      u know why does it take 40 plus min cuz he gives intution, he proves why a solution works and other not, then comes to the solution.

    • @aastikofficial6100
      @aastikofficial6100 Před 4 měsíci +1

      @@VishalKumar-lw3yh ya i already watched it and code it morever easy to understand

    • @vinaychauhan2110
      @vinaychauhan2110 Před 4 měsíci

      Because it is necessary for noob like me😅

    • @AYJ959
      @AYJ959 Před 4 měsíci +1

      Its easy to make a 15 min video and get more views and also he explained 4 solutions. what you want 4 approaches of dp & graph in 15 min video?