jaekookang
update examples
887f6b2
raw history blame
No virus
319 Bytes
def best_overlap(a, b):
return max([(score(a[offset:], b), offset) for offset in range(len(a))], key=lambda x: x[0])[1]
def score(a, b):
return sum([a[i] == b[i] for i in range(len(a))])
a = 'abcde'
b = 'abbde'
print(best_overlap(a, b))
print(a + '-' * best_overlap(a, b))
print('-' * best_overlap(a, b) + b)