subject :
"""
Here are two strings haystack and needle ,
Please come in haystack Find in string needle The first place the string appears ( Subscript from 0 Start ). If it doesn't exist , Then return to -1 .
"""
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
if haystack==needle=='':
return 0
length = len(needle)
for i in range(len(haystack)):
if haystack[i:i+length] == needle:
return i
return -1
haystack = ""
needle = ""
S = Solution()
result = S.strStr(haystack,needle)
print(result)