Implement strStr().
Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
求一字符串在另一字符串中第一次出现的位置
class Solution(object):
def strStr(self, haystack, needle):
for i in range(0, len(haystack) - len(needle) + 1):
if haystack[i:i + len(needle)] == needle:
return i
return -1