This was an easy problem.


Solution

class Solution:
    def strStr(self, haystack: str, needle: str) -> int:
        for j in range(len(haystack)):
            if haystack[j:j + len(needle)] == needle:
                return j
        return -1

O(n) = n