Python one linear

  • 0

    Well actually call build-in function in python works for it.
    It's internally using KMP.

    class Solution(object):
        def strStr(self, haystack, needle):
            :type haystack: str
            :type needle: str
            :rtype: int
            return haystack.find(needle)

Log in to reply

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