266A - Stones on the Table

Run Settings
LanguagePython
Language Version
Run Command
def colored_stones(num, colors): count = 0 for i in range(0, len(colors) - 1): if colors[i] == colors[i+1]: count += 1 else: continue return count if __name__ == '__main__': num = int(input()) colors = input() print(colored_stones(num, colors))
Editor Settings
Theme
Key bindings
Full width
Lines