4 line in pyhton


  • 0
    1
    class Solution(object):
        def strStr(self, haystack, needle):
            if needle in haystack:
                return haystack.index(needle)
            else:
                return -1
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.