- in 연산자로 haystack에 needle이 있는 지 확인
- 없으면 -1, 있으면 index method의 값을 return
class Solution:
def strStr(self, haystack: str, needle: str) -> int:
if needle in haystack :
return haystack.index(needle)
else :
return-1