본문 바로가기
python-algorithm

Leetcode 28. Implement strStr()

by 무적김두칠 2021. 7. 13.

1
2
3
4
class Solution:
    def strStr(self, haystack: str, needle: str-> int:
        if needle in haystack : return (haystack.index(needle))
        elsereturn -1
cs
반응형

'python-algorithm' 카테고리의 다른 글

백준 22193 Multiply  (0) 2021.07.15
백준 5539 콜센터  (0) 2021.07.15
Leetcode 1512. Number of Good Pairs  (0) 2021.07.13
Leetcode 1470. Shuffle the Array  (0) 2021.07.13
Leetcode 1431. Kids With the Greatest Number of Candies  (0) 2021.07.13

댓글