Edit Distance (LeetCode 72) | Full step by step solution with thought process | Dynamic Programming

Sdílet
Vložit
  • čas přidán 26. 07. 2024
  • Actual problem on LeetCode: leetcode.com/problems/edit-di...
    Chapters:
    00:00 - Intro
    00:48 - Problem Statement and Description
    03:23 - What are operations?
    04:57 - Brute Force Won’t work
    07:07 - Dynamic Programming with Memoization
    19:12 - Dry-run of Code
    21:13 - Final Thoughts
    📚 Links to topics I talk about in the video:
    LeetCode Problems: • Leetcode Solutions
    Other String Problems: • Strings
    Brute Force: • Brute Force algorithms...
    Dynamic Programming: • Dynamic Programming ea...
    📘 A text based explanation is available at: studyalgorithms.com
    Code on Github: github.com/nikoo28/java-solut...
    Test-cases on Github: github.com/nikoo28/java-solut...
    📖 Reference Books:
    Starting Learn to Code: amzn.to/36pU0JO
    Favorite book to understand algorithms: amzn.to/39w3YLS
    Favorite book for data structures: amzn.to/3oAVBTk
    Get started for interview preparation: amzn.to/39ysbkJ
    🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
    🎥 My Recording Gear:
    Recording Light: amzn.to/3pAqh8O
    Microphone: amzn.to/2MCX7qU
    Recording Camera: amzn.to/3alg9Ky
    Tablet to sketch and draw: amzn.to/3pM6Bi4
    Surface Pen: amzn.to/3pv6tTs
    Laptop to edit videos: amzn.to/2LYpMqn
    💻 Get Social 💻
    Follow on Facebook at: / studyalgos
    Follow on Twitter at: / studyalgorithms
    Follow on Tumblr at: / studyalgos
    Subscribe to RSS feeds: studyalgorithms.com/feed/
    Join fan mail: eepurl.com/g9Dadv
    #leetcode #programming #interview

Komentáře • 31

  • @luminraja09
    @luminraja09 Před 2 měsíci +3

    I went through lot of solution videos. Yours is so easy to understand . Keep up the great work :)

  • @juniorferreira1358
    @juniorferreira1358 Před 11 měsíci

    Thank you very much! The information provided was easy to comprehend.

  • @jamjam3448
    @jamjam3448 Před 2 měsíci

    wowwww. Finallyyyy. I have understood this! Thanks a million!

  • @ahmedtremo
    @ahmedtremo Před 6 měsíci +1

    Great explanation, Thanks!

  • @jatinkumar4410
    @jatinkumar4410 Před 3 měsíci +1

    Amazing explanation 🙌

  • @samridhshubham8109
    @samridhshubham8109 Před 11 měsíci +1

    Absolutely perfect

  • @NiteenChougula-fs9ij
    @NiteenChougula-fs9ij Před 11 měsíci +1

    I've been searching for quality DSA lectures on CZcams, and I'm delighted to have found excellent your channel.
    I'm eager to watch your videos and deepen my understanding of DSA.
    Thank you for clear and quality video.

    • @nikoo28
      @nikoo28  Před 11 měsíci +1

      Thank you so much Niteen for being a member and supporting my channel. It really motivates me to keep working hard and bringing out the best. Remember that as a member, you do get priority reply to comments and queries. :)

  • @xxxmin0uxxx858
    @xxxmin0uxxx858 Před 10 měsíci

    nikil, thank you so much my brother , a big fan from algeria

    • @nikoo28
      @nikoo28  Před 9 měsíci

      happy to have you

  • @AyushSharma-tj1kp
    @AyushSharma-tj1kp Před 16 dny

    why did we compare string at i-1 and j-1 ??

  • @deepakkumar13204
    @deepakkumar13204 Před 8 měsíci +1

    Thank you bhaiya you are explain very well like striver ।। Are you preparing for any company..

  • @joyantamitra8186
    @joyantamitra8186 Před 7 měsíci +1

    How do you know, you have to attack this problem in this way at the first glance?

    • @nikoo28
      @nikoo28  Před 7 měsíci +2

      The more you practice, the more patterns you will start to observe. No shortcut my friend :)

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

    It was great ! Thanks !

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

    u explained xactly how its to be done
    not just filling table

  • @shaistakhan9048
    @shaistakhan9048 Před rokem

    Thank you!!!!!! Love your Teaching style

  • @aalialokhandwala8950
    @aalialokhandwala8950 Před 10 měsíci

    can you tell me that while initialization of matrix, why are we traversing from the 1st index and not 0?

    • @nikoo28
      @nikoo28  Před 9 měsíci

      the first row and column will all be zeroes

  • @himajap2446
    @himajap2446 Před rokem

    Can someone let me know why do we initialize dp with length (m+1, n+1), why we have to consider empty char at begging of the appraoch?

    • @nikoo28
      @nikoo28  Před rokem

      Because empty character is also a valid test case

    • @nikoo28
      @nikoo28  Před rokem

      If you have an input like this
      str1 = “abcd”
      str2 = “”
      This is a perfectly valid test case and it’s answer will be 4.

    • @SHADOW_736
      @SHADOW_736 Před rokem

      ​@@nikoo28o

  • @vyshakkriss7765
    @vyshakkriss7765 Před rokem

    I am new to dynamic programming! Good video! Keep making such videos. Although i did not understand it completely, I got a new idea on how to work on problems rather than going straight to brute force methods! Thanks

    • @nikoo28
      @nikoo28  Před rokem

      What part did you face a problem with?? I can help

  • @sobitregmi31
    @sobitregmi31 Před rokem

    Can you please make video on word break and equal sum partition problem

  • @k.k.harjeeth5422
    @k.k.harjeeth5422 Před 10 měsíci

    Lucid !

  • @RomanHaivaronski
    @RomanHaivaronski Před 10 měsíci

    What is the complexity of this solution?
    Is it O(n) + O(n) + O(n^2)?

    • @nikoo28
      @nikoo28  Před 9 měsíci

      I explain it at 20:56

  • @shaistakhan9048
    @shaistakhan9048 Před rokem +1

    waiting for more videos on strings