class Solution:
def asteroidCollision(self, asteroids: List[int]) -> List[int]:
q = []
for x in asteroids:
# 处理相对运行 0 < y <= -x
while q and q[-1] > 0 and x < 0:
if q[-1] <= -x:
y = q.pop()
if y == -x: break
else: break
else: q.append(x)
return q



