Skip to content

Instantly share code, notes, and snippets.

View gist:d3daa37e58cadc24ae30
class Solution(object):
def strStr(self, source, target):
if source == None or target == None:
return -1
len_t = len(target)
if len_t == 0:
return 0
pos_s = 0
for char_s in source[:-len_t]:
pos_t = 0