Overlap X17922


Statement
 

pdf   zip

html

Write a string function max_overlap(s, t) that given two strings s and t returns the longest string that is a common prefix of s and t.

Sample session
>>> max_overlap('bugs', 'bunny')
'bu'
>>> max_overlap('winter', 'winner')
'win'
>>> max_overlap('hand', 'made')
''
>>> max_overlap('x', 'x')
'x'
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python