def suffix(x, y):
    """length of the longest common suffix of x and y"""
    bound = min(len(x), len(y))
    for i in range(bound):
        a = x[-(1 + i)]
        b = y[-(1 + i)]
        if a != b:
            return i
    return bound
