for i in range(len(pattern) - 1, -1, -1):
    c = pattern[i]
if c not in map:
    map[c] = i
return map
if __name__ == '__main__':
    matches = match('ana', 'bananas')
for integer in matches:
    print('Match at:', integer)
print(matches == [1, 3] and 'OK' or 'Failed')
matches = match([1, 2, 3], [0, 1, 2, 3, 4, 5, 6])
for integer in matches:
    print('list Match at:', integer)
print(matches)
Как заменить все экземпляры подпоследовательности в списке в Python?