28. Find the Index of the First Occurrence in a String | JavaScript | LeetCode Daily Challenge

Join my Discord channel / discord
I have created a detailed solution to the problem along with examples.
Solution: leetcode.com/problems/find-th...
Problem: leetcode.com/problems/find-th...
I have created a detailed video solution for the leetcode daily challenge.
#javascript #leetcode #leetcodedailychallenge #coding
Connection Info:
LeetCode: leetcode.com/monuchaudhary1/
LinkedIn: / monu-chaudhary
Instagram: / monu.chaudhary9

Пікірлер: 11

  • @gowthamtalkies
    @gowthamtalkies Жыл бұрын

    Great video! I really enjoyed watching it. Your problem-solving methods are very nice and easy to understand. Keep doing what you're doing. You deserve more subscribers for the effort you put into making such informative and helpful content.

  • @LeetCodeWithMonu

    @LeetCodeWithMonu

    Жыл бұрын

    Thank you for supporting. Feedbacks like yours keep me motivated to create more informative videos.

  • @mrawesome1821
    @mrawesome1821 Жыл бұрын

    Wow, literally best video explanation I've seen. Keep it up!

  • @LeetCodeWithMonu

    @LeetCodeWithMonu

    Жыл бұрын

    Thanks, will do!

  • @sauravrath592
    @sauravrath592 Жыл бұрын

    The time complexity on which you solved is O(n^2). This problem can be solved in O(n) using KMP string search algorithm.

  • @LeetCodeWithMonu

    @LeetCodeWithMonu

    10 ай бұрын

    thanks for mentioning this

  • @juxtapose2125
    @juxtapose21259 ай бұрын

    hello! why is my solution 'return haystack.indexOf(needle)' bad? i don't know much about time complexity and etc. because I mainly practice web development, but I've heard of it. can you explain why my answer would be bad?

  • @joydeep_

    @joydeep_

    Ай бұрын

    Its probably best because its a standard function, but that does not test your logical ability right.

  • @sankaranarayanankm7049
    @sankaranarayanankm7049 Жыл бұрын

    will you please add deocde string problem

  • @LeetCodeWithMonu

    @LeetCodeWithMonu

    Жыл бұрын

    Always. Let me know if you need help with any LeetCode problem.

  • @agtech3768
    @agtech37685 ай бұрын

    var strStr = function (haystack, needle) { let pointer = 0; for (let i = 0; i if (haystack[i] !== needle[pointer]) { i = i - pointer; pointer = 0; } else if (pointer === needle.length - 1) { return i - pointer; } else{ pointer ++; } } return -1; };