Leetcode 28: Find the Index of First Occurrence in a String | Java Solution

preview_player
Показать описание
Going over the Java Solution for Leetcode 28: Find the Index of First Occurrence in a String.

#coding #java #leetcode #computerscience #codinginterview #computer #programming #javaprogramming #28
Рекомендации по теме
Комментарии
Автор

Cool solution! The first solution looks like it takes O(N) time where N is the length of the haystack, however, it is taking O(N*M) where N is len of haystack and M is length of needle.

mayankmudgal
Автор

What is the need of line number 8
I don't get it

SahilAli-uqym