func asteroidCollision(asteroids []int) (stk []int) {
for _, x := range asteroids {
if x > 0 {
stk = append(stk, x)
} else {
for len(stk) > 0 && stk[len(stk)-1] > 0 && stk[len(stk)-1] < -x {
stk = stk[:len(stk)-1]
}
if len(stk) > 0 && stk[len(stk)-1] == -x {
stk = stk[:len(stk)-1]
} else if len(stk) == 0 || stk[len(stk)-1] < 0 {
stk = append(stk, x)
}
}
}
return
}