def expand(s, c, r=0):
    """ Expands the palindrome in s centered in c starting with starting radius of r.
    Returns the radius of the largest palindrome in s centered in c.
    """
    while c-r >= 0 and c+r < len(s) and s[c+r] == s[c-r]:
        r += 1
    return r - 1