Below is the described substring searching algorithm:
def contains(text, pattern):
for i in range(len(text) - len(pattern)):
found = True
for j in range(len(pattern)):
if text[i + j] != pattern[j]:
found = False
break
if found:
return True
return False
This version contains a mistake. Select all pairs of strings (the first is text, the second is pattern), for which the algorithm above gives an incorrect output.