3031. Minimum Time to Revert Word to Initial State II | KMP | Weekly Contest 383 | String Matching

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • In this video, I'll talk about how to solve Leetcode 3031. Minimum Time to Revert Word to Initial State II | KMP | String Matching Algorithm
    3029. Minimum Time to Revert Word to Initial State I
    3031. Minimum Time to Revert Word to Initial State II
    KMP Algorithm - • Find Beautiful Indices...
    Checkout DSA-169 Series: • Aryan DSA-169 Series |...
    100Days 100k Placements: • 100 Days 100K Placement
    Let's Connect:
    📝Linkedin: / aryan-mittal-0077
    📸 Instagram: / ez.pz.dsa
    📱Telegram : t.me/aryan_mittal_group
    🤖 Github: github.com/aryan-0077
    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 :)
    ✨ Timelines✨
    0:00 - Problem Explanation
    2:56 - Intuition Of worst case
    12:55 - 3029. Minimum Time to Revert Word to Initial State I
    20:22 - 3031. Minimum Time to Revert Word to Initial State II
    30:42 - Explaining logic of how lps works internally
    39:00 - Code Explanation
    ✨ Hashtags ✨
    #programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Komentáře • 16

  • @himanshuadhikari9440
    @himanshuadhikari9440 Před 5 měsíci +7

    you should have discussed the implementation of Z Algo too and the advantage of using Z algo over KMP here or vica versa

  • @ishank562
    @ishank562 Před 26 dny

    bahut pyaara explanation sir(bro).. maja aa gaya especially after watching your KMP lecture

  • @Chesstreamer
    @Chesstreamer Před 5 měsíci +1

    Just Excellent explanation and understanding of concepts. Mark my words , going to be the best channel possible for coding. Bring it on man!

  • @kroozcastro9636
    @kroozcastro9636 Před 5 měsíci

    Thank you bro (sir) greetings from Mexico!

  • @riteshmangdare
    @riteshmangdare Před 5 měsíci +1

    Best explanation possible!

  • @abedosmani9251
    @abedosmani9251 Před 5 měsíci

    thanks a lot

  • @ravikiranreddy2867
    @ravikiranreddy2867 Před 5 měsíci +2

    in your code of 1st approach word.substr(0,n-i) and wor.substr(i,n-i) will never be equal as they are of different length . then why we are checking it ?

    • @ARYANMITTAL
      @ARYANMITTAL  Před 5 měsíci

      Bro, n-i is the length & you can see its same 🙃

    • @SahillKhn
      @SahillKhn Před 5 měsíci

      @@ARYANMITTAL I think the condition should be word.substring(i,n) and not word.substring(i,n-i)

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

      @@SahillKhn He is using C++, in C++ we do via length. But in java i.e. you referring to, it is done via excluding indices.
      For java both words are:
      word.substring(i, n), word.substring(0, n-i)

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

    bro when will rabinkarp video come..it helps a lot for my interview preparation
    kindly upload it ASAP and make 100 days placement vids more regularly!!!

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

      Haan Satwik bhai, iss weekend vahi laaenge sabse phele ❤️❤️🙇

  • @kcecse
    @kcecse Před 5 měsíci

    Awesome

  • @DreamFist
    @DreamFist Před 5 měsíci

    bhaiya rabin karp ki video kab ayegi

    • @ARYANMITTAL
      @ARYANMITTAL  Před 5 měsíci +1

      Dream Fist bhai, lecture written hai, baas 100days 100k placements series ka part hai, toh usi ke video series me Day28 ka part hai, both single Hashing & Double Hashing❤️❤️🙏

    • @DreamFist
      @DreamFist Před 5 měsíci

      Okay bhaiya ❤️🙏