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

Поделиться
HTML-код
  • Опубликовано: 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!

  • @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

  • @amirahassan1852
    @amirahassan1852 17 дней назад

    OMG! , I think I found my favorite youtube channel

  • @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: ruclips.net/video/VtC4GUR31wQ/видео.html
      Merge Two Sorted (Linked) Lists: ruclips.net/video/E5XXiY6QnAs/видео.html
      Linked List Cycle: ruclips.net/video/RRSItF-Ts4Q/видео.html

  • @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: ruclips.net/p/PLx2fZyxEuihLSjtEzLKxf20yV8LKLAibL

  • @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!!!