def lcp(s1, s2):
    """Return the length of the longest common prefix
    between strings `s1` and `s2`."""
    comp = 0
    for i in range(min(len(s1), len(s2))):
        if s1[i] != s2[i]:
            break
        comp += 1
    return comp