735 Asteroid Collision
735. Asteroid Collision
1. Question
Input: asteroids = [5, 10, -5]
Output: [5, 10]
Explanation: The 10 and -5 collide resulting in 10. The 5 and 10 never collide.Input: asteroids = [8, -8]
Output: []
Explanation: The 8 and -8 collide exploding each other.2. Implementation
3. Time & Space Complexity
Last updated