Find the index of the first occurrence in a string | Leetcode 28 | O(n) time Complexity

Поделиться
HTML-код
  • Опубликовано: 1 фев 2025

Комментарии • 11

  • @codecreww
    @codecreww Год назад +2

    Very nice, keep posting new videos

  • @balajib2498
    @balajib2498 9 месяцев назад +1

    This might be misleading. n real interviews they wont accept this indexOf() predefined things, they wanted implementation from ground to check our knowledge, I won't say this is wrong but it will be better if you explain the other non pre defined approaches like Knuth-morris-pratt algorithm so it may help your subscribers who preparing for interviews.

  • @kritikagupta5281
    @kritikagupta5281 Год назад +2

    you have used an inbuilt function 'indexOf' in JAVA. i don't think this is the expectation, the expectation of this question is to implement the said 'indexOf' function. Your solution and title solving in O(n) are misleading

    • @TechnosageLearning
      @TechnosageLearning  Год назад

      IndexOf() also runs in linear time..internally it iterates through each element one by one,so time complexity of this operation is always O(n).. So we can definitely use indexOf() function to solve this problem...There is no need to implement to solve this Problem..

  • @quickknowledge1401
    @quickknowledge1401 Год назад +1

    Nice explanation

  • @dianakyrychyk3731
    @dianakyrychyk3731 Год назад

    Thank you! 😃

  • @royalsingh9400
    @royalsingh9400 Год назад

    Logic kaise develop kare. Mujhe qus nhi hota bina solution dekhe

    • @TechnosageLearning
      @TechnosageLearning  Год назад +1

      Its ok agar aap initially solution dekh rhe ho. Apke ek solution dekhne se same logic ya type k baki questions khud se krne mai help milegi.

  • @hariprasad2697
    @hariprasad2697 Год назад +1

    S U P E R B☀️💗✨