View difference between Paste ID: 2Yeu2Pyx and GCfKJLwz
SHOW: | | - or go back to the newest paste.
1
def alternating_characters(s):
2
    new_string = list(s)
3
    final_string = new_string[0]
4-
    total = 0
4+
5
        if new_string[i] != new_string[i - 1]:
6
            final_string = final_string + new_string[i]
7
            break
8
    return len(new_string) - len(final_string)
9-
    return total
9+
10
test_cases = int(input())
11
for i in range(test_cases):
12
    print(alternating_characters(input()))