Skip to content

Commit 6b33442

Browse files
committed
Update 28. Implement strStr().py
1 parent bab2247 commit 6b33442

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

28. Implement strStr().py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def get_next(self, s: str) -> List[int]:
2222
return next_list
2323

2424
def strStr(self, haystack: str, needle: str) -> int:
25-
next_list = self.get_next(haystack)
25+
next_list = self.get_next(needle)
2626
j = 0
2727
i = 0
2828
while i < len(haystack) and j < len(needle):
@@ -58,6 +58,6 @@ def strStr1(self, haystack, needle):
5858
return -1
5959

6060
if __name__ == '__main__':
61-
haystack = "mississippi"
61+
haystack = "ababc"
6262
needle = "issip"
6363
print(Solution().strStr(haystack, needle))

0 commit comments

Comments
 (0)