def _lcp(lst):
    """Returns the longest common prefix from a list."""
    if not lst:
        return ""
    cleanlst = list(map(lambda x: x.replace("[", "").replace("]", ""), lst))
    s1 = min(cleanlst)
    s2 = max(cleanlst)
    for i, c in enumerate(s1):
        if c != s2[i]:
            return s1[:i]
    return s1