Overlap X17922


Statement
 

pdf   zip

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

Sample session

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