diff --git a/028_Find-the-Index-of_the_First_Occurrence_in_a_string.py b/028_Find-the-Index-of_the_First_Occurrence_in_a_string.py new file mode 100644 index 0000000..0403348 --- /dev/null +++ b/028_Find-the-Index-of_the_First_Occurrence_in_a_string.py @@ -0,0 +1,5 @@ +class Solution: + def strStr(self, haystack: str, needle: str) -> int: + index: int=-1 + index=haystack.find(needle) + return index