def strStr(self, haystack, needle):
if not needle in haystack:
That's not O(n). Unless you define n as the product of the string lengths, which would be very weird.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.