class Solution:
def strStr(self, haystack: str, needle: str) -> int:
for i in range(len(haystack)):
if haystack[i] == needle[0]:
j = i
k = 0
while j < len(haystack) and k < len(needle) and haystack[j] == needle[k]:
j += 1
k += 1
if k == len(needle):
return i
return -1