NeetCode #354LC-735MediumStackNC 250
← Back to All Problems#354 · #735 · Asteroid Collision(小行星碰撞)
📌 Problem Statement & Constraints
We are given an array
asteroids of integers representing asteroids in a row. The absolute value is the size and the sign is the direction (positive = right, negative = left). When two asteroids collide, the smaller explodes; equal sizes both explode. Asteroids moving in the same direction never collide. Return the state after all collisions. Constraints: 2 <= asteroids.length <= 10^4, -1000 <= asteroids[i] <= 1000, no zero values.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!