def find_flipped_bit(s1, s2):
    """ For two adjacent elements in a gray code, determine which bit is the 
    one that was flipped.
    """
    if len(s1) == 0 or len(s2) == 0:
        raise ValueError("Empty string inputted.")

    if len(s1) != len(s2):
        raise ValueError("Strings compared in gray code must have the same length.")
    
    if any([x != "0" and x != "1" for x in s1]) or any([x != "0" and x != "1" for x in s2]):
        raise ValueError(f"One of inputs {s1}, {s2} is not a valid binary string.")
    
    # Sum the strings elementwise modulo 2; the sum will be 1 only in the slot 
    # where we flipped a bit        
    string_sums = [(int(s1[i]) + int(s2[i])) % 2 for i in range(len(s1))]

    if string_sums.count(1) == 0:
        raise ValueError(f"Strings {s1} and {s2} are the same.")
    elif string_sums.count(1) > 1:
        raise ValueError(f"Strings {s1} and {s2} are not ordered in a gray code.")

    return string_sums.index(1)