Add comment to 28. Find the Index of the First Occurrence in a String

This commit is contained in:
Kiril Kovachev 2024-03-08 17:27:52 +00:00
parent 127c2a32f4
commit 30e48785a8

View File

@ -1,3 +1,5 @@
# Also consider using the KMP algorithm for better asymptotic performance (O(n+m) vs O(nm)).
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
for i in range(len(haystack)):