题解 | #点击消除#
点击消除
https://www.nowcoder.com/practice/8d3643ec29654cf8908b5cf3a0479fd5
s = input()
stack = []
for i in s:
if stack and stack[-1] == i:
stack.pop()
else:
stack.append(i)
if not stack:
print(0)
for i in stack:
print(i, end='')
查看9道真题和解析
