Edit Distance | Dynamic Programming | LeetCode 72 | C++, Java, Python

Поділитися
Вставка
  • Опубліковано 19 вер 2024
  • LeetCode Solutions: • LeetCode Solutions | L...
    June LeetCoding Challenge: • Playlist
    May LeetCoding Challenge: • Playlist
    *** Best Books For Data Structures & Algorithms for Interviews:*********
    1. Cracking the Coding Interview: amzn.to/2WeO3eO
    2. Cracking the Coding Interview Paperback: amzn.to/3aSSe3Q
    3. Coding Interview Questions - Narasimha Karumanchi: amzn.to/3cYqjkV
    4. Data Structures and Algorithms Made Easy - N. Karumanchi: amzn.to/2U8FrDt
    5. Data Structures & Algorithms made Easy in Java - N. Karumanchi: amzn.to/2U0qZgY
    6. Introduction to Algorithms - CLR - Cormen, Leiserson, Rivest: amzn.to/2Wdp8rZ
    *****************************************************************************
    May LeetCoding Challenge | Problem 31 | Edit Distance | 31 May,
    Facebook Coding Interview question,
    google coding interview question,
    leetcode,
    Edit Distance,
    Edit Distance c++,
    Edit Distance Java,
    Edit Distance python,
    Edit Distance solution,
    72. Edit Distance,
    Dynamic Programming,
    #Facebook #CodingInterview #LeetCode #MayLeetCodingChallenge #Google #Amazon #EditDistance

КОМЕНТАРІ • 28

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

    I am amazed by the clarity in which you teach. if you continue to upload such excellent contains there is no doubt for your success. You are amazing bro.

  • @niteshbagla6045
    @niteshbagla6045 4 роки тому +2

    Really u taught better then my proffesional AD teacher, especially the delete, substitute and insert part..... now its easy to remember and didn't need to learn it,,, THANKS

  • @rajeshg1737
    @rajeshg1737 4 роки тому +2

    The way you explain the solution is very clear. I watched till ~7 mins and I tried to code myself and got it right whereas I was initially wondering how to start.

    • @KnowledgeCenter
      @KnowledgeCenter  4 роки тому

      Great. Good job. I recommend this way to others as well.

  • @crankyinmv
    @crankyinmv 4 роки тому +2

    Yup, this is the one which kept me from finishing the May challenge. Really liked your clear explanation. It's obvious at this point I was taking the wrong approach.

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

    great explanation and hint! I watched upto 6:38 and was able to solve it...

  • @srijansaini6277
    @srijansaini6277 4 роки тому +1

    Really your way of describing is amazing!!

  • @ravinalawade6842
    @ravinalawade6842 4 роки тому +1

    nice explanation of recursive solution and then converting it into DP solution

  • @JardaniJovonovich192
    @JardaniJovonovich192 4 роки тому +2

    How did you get an idea to directly jump to last characters and then start comparing and then apply DP ?
    By reading the question itself did you understand that this is a DP problem ?
    How do we know that we have to follow DP approach to any problem ?

    • @KnowledgeCenter
      @KnowledgeCenter  4 роки тому +5

      Breaking the problem into smaller sub-problems should always be in your mind. For problems dealing with 2 strings, How would you reduce your problem size?
      Either from front or end. The goodness with end is that, we will need to keep track of just end, beginning is implicitly 0.
      That's how my approach is how to reduce the problem size.
      DP idea will automatically come, when you see that, the main function can be written in recursive form in terms of smaller subproblems. Then you should check if there are overlaps in the smaller problems. That's it. We need to avoid recomputing same things.
      For this problem specifically, experience of solving Longest Common Subsequence problem would help.

  • @manishpanwar2517
    @manishpanwar2517 4 роки тому +1

    Loved it

  • @yangiiu4347
    @yangiiu4347 4 роки тому +1

    Love your videos, follow you with LeetCode problems.
    BTW in python min(3, 5, 2...) is legal.

    • @KnowledgeCenter
      @KnowledgeCenter  4 роки тому +1

      Cool, thanks for the info. That would save some effort.

  • @srikantsharma6430
    @srikantsharma6430 4 роки тому +1

    Nice explanation!

  • @DD-ko4dt
    @DD-ko4dt 4 роки тому +2

    Add to Everyday Checklist: Knowledge Center UA-cam channel

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

    great!! but how to code explanation like horse->rorse (replace'h' with 'r')......can u help me to code🙏🙏🙏🙏

  • @varunagarwal28
    @varunagarwal28 4 роки тому

    Awesome explanation

  • @ghumakkad_yogi
    @ghumakkad_yogi 4 роки тому +1

    Can you made video on Google kickstart challenges also?

    • @KnowledgeCenter
      @KnowledgeCenter  4 роки тому +1

      Sure. Will look into it. I was not aware of it.