def react_polymer(polymer_string):
    """
    Iterate through polymer_string, replacing all instances where two
    adjacent characters are case-insensitive equal but not equal (i.e. A and a)
    with the empty string
    """
    # convert to a list since strings are immutable
    polymer_list = [i for i in polymer_string]
    index = 0
    while index < len(polymer_string) - 1:
        char = polymer_list[index]
        try:
            next_char = polymer_list[index + 1]
        except IndexError:
            break
        if next_char.casefold() == char.casefold() and next_char != char:
            # remove the char at index twice to get rid of char and next_char
            char1 = polymer_list.pop(index)
            char2 = polymer_list.pop(index)
            assert char1 == char
            assert char2 == next_char
            index = max([index - 2, 0])
            continue
        index += 1
    # Not technically necessary, but I like to maintain type coherence
    polymer_string = ''.join(polymer_list)
    return polymer_string