题解 | #点击消除#
点击消除
https://www.nowcoder.com/practice/8d3643ec29654cf8908b5cf3a0479fd5
import sys str=input() list1=[] for char in str: if len(list1)==0: list1.append(char) elif len(list1)>=1 and list1[-1]!=char: list1.append(char) elif len(list1)>=1 and list1[-1]==char: list1.pop() if len(list1)==0: print(0) else: print(''.join(list1))