题解 | 点击消除
点击消除
https://www.nowcoder.com/practice/8d3643ec29654cf8908b5cf3a0479fd5
def rm(s:str) ->str: stack = [] for char in s: if stack and stack[-1] == char: stack.pop() else: stack.append(char) return ''.join(stack) if stack else '0' ss = input() print(rm(ss))