(strings)
return substr
Returns the longest common substring of the given strings
Returns the longest common substring of the given strings
Returns the longest common substring of the given strings
def longest_substr(strings):
    """
    Returns the longest common substring of the given strings
    """

    substr = ""
    if not strings:
        return substr
    reference = shortest_of(strings)
    length = len(reference)
    # find a suitable slice i:j
    for i in range(length):
        # only consider strings long at least len(substr) + 1
        for j in range(i + len(substr) + 1, length):
            candidate = reference[i:j]
            if all(candidate in text for text in strings):
                substr = candidate
    return substr
def longest_substr ( strings ) : substr = "" if not strings : return substr reference = shortest_of ( strings ) length = len ( reference ) # find a suitable slice i:j for i in range ( length ) : # only consider strings long at least len(substr) + 1 for j in range ( i + len ( substr ) + 1 , length ) : candidate = reference [ i : j ] if all ( candidate in text for text in strings ) : substr = candidate return substr