题解 | #点击消除#
点击消除
https://www.nowcoder.com/practice/8d3643ec29654cf8908b5cf3a0479fd5
stack = []
a_str = input()
for char in a_str:
if stack and char == stack[-1]:
stack.pop()
else:
stack.append(char)
res = "".join(stack)
print(res if res else 0)
查看11道真题和解析