lcs

lcs(*strings: str) str[source][source]

Find the longest common substring in a list of strings.

Parameters:

*strings (str) – The strings to find the longest common substring of.

Returns:

The longest common substring in the list of strings.

Return type:

str

Examples

>>> lcs('ABAB')
'ABAB'
>>> lcs('ABAB', 'BABA')
'ABA'
>>> lcs('ABAB', 'BABA', 'ABBA')
'AB'