Simple python code without any in-built functions


#1

def strStr(self, A, B):
for i in range(len(A)-len(B)+1):
if A[i:len(B)+i]==B:
return i
return -1