LeetCode #28: Find Index of First Occurrence in a String | KMP Algorithm

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ม.ค. 2025

ความคิดเห็น • 12

  • @ocoocososococosooooosoococoso
    @ocoocososococosooooosoococoso 7 หลายเดือนก่อน +3

    2:53 one of the best KMP Algorithm explanation. This channel is so underrated and most efficient way of visual presentation with the code line. So easy to follow up and understand. Thank you so much.

  • @jerry-kz1tj
    @jerry-kz1tj 22 วันที่ผ่านมา

    This is insane! Greatest explanation ever seen!

  • @amirahassan1852
    @amirahassan1852 17 วันที่ผ่านมา

    OMG! , I think I found my favorite youtube channel

  • @sohsueping9560
    @sohsueping9560 ปีที่แล้ว +4

    Hi Algo engine, it’s surpriseme here from leetcode. I m still stuck at this video after one week. I m gng to try learning it again tmr. I went to read up and watch more about big o notation after I m stuck. I m planning to write about the KMP algorithm on my website in a few weeks time and hope u r ok that I post ur video in that article. Glad that we can comment here now! Thank you for all ur hard work in helping us!

    • @AlgoEngine
      @AlgoEngine  ปีที่แล้ว +3

      KMP is definitely tough and it takes a while to sink in. And sure, feel free to post my video on your website!

  • @jironymojirolamus913
    @jironymojirolamus913 ปีที่แล้ว +2

    Great explanation, many thanks!

  • @himanshu_27tt
    @himanshu_27tt 7 หลายเดือนก่อน +2

    this is the hardest algorithm that i have ever seen

  • @alperenakbas9811
    @alperenakbas9811 ปีที่แล้ว +4

    Great video as always! I am new to this and I would like to ask, is it sensible to add "break" after returning h - n + 1 to prevent further unnecessary iteration and make the program faster? And can you tackle a problem including linked-lists, I try to understand how they work and how to work with them but they are a bit confusing. Thanks!

    • @AlgoEngine
      @AlgoEngine  ปีที่แล้ว +4

      Great question! Once a function hits "return", it exits that function completely and nothing else in the function is executed. So while I like the idea, adding "break" after "return" would be unnecessary because "break" would never be executed.
      As for linked lists, I currently have three videos up that tackle LeetCode linked list problems. Keep an eye out for more coming soon!
      Reverse a Linked List: th-cam.com/video/VtC4GUR31wQ/w-d-xo.html
      Merge Two Sorted (Linked) Lists: th-cam.com/video/E5XXiY6QnAs/w-d-xo.html
      Linked List Cycle: th-cam.com/video/RRSItF-Ts4Q/w-d-xo.html

  • @yusufnurwahid898
    @yusufnurwahid898 10 หลายเดือนก่อน

    Hi, can you explain more for time range 6:43-6:53?
    Why 'a' is an LPS?
    I thought the LPS is "ab".
    Overall, great explanation!!!

  • @JimmySquiky
    @JimmySquiky ปีที่แล้ว +1

    Hello, thanks for the videos ! They're really helpful. I'm a beginner and would like to know which leetcodes problem to focus on to have a well rounded base and make it easier to solve more complex ones later on ?

    • @AlgoEngine
      @AlgoEngine  ปีที่แล้ว +1

      I would start with the problems marked "easy" first. When you feel like you've got the hang of it, try tackling some "medium" level problems. I would also recommend doing the questions in the LeetCode Blind 75 list - I've begun adding those videos to this playlist here: th-cam.com/play/PLx2fZyxEuihLSjtEzLKxf20yV8LKLAibL.html