Skip to content

Commit f7012a3

Browse files
Create 028_Find-the-Index-of_the_First_Occurrence_in_a_string.py
1 parent d864fdf commit f7012a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class Solution:
2+
def strStr(self, haystack: str, needle: str) -> int:
3+
index: int=-1
4+
index=haystack.find(needle)
5+
return index

0 commit comments

Comments
 (0)