leetcode 풀이/String1 leetcode 28. Find the index of the First Occurence in a String https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string/ 미디움이라고 하지만, 전혀 미디움 난이도가 아닌 문제 class Solution(object): def strStr(self, haystack, needle): """ :type haystack: str :type needle: str :rtype: int """ if needle in haystack : return haystack.index(needle) return -1 2023. 1. 21. 이전 1 다음