NeetCode #376LC-2751HardStack
← Back to All Problems#376 · #2751 · Robot Collisions(机器人碰撞)
📌 Problem Statement & Constraints
You are given arrays
positions, healths and directions describing robots. Robots move in their direction at the same speed; when two moving toward each other collide, the one with less health is destroyed and the other loses 1 health; equal health destroys both. Robots moving apart never collide. Return the healths of the surviving robots in the original input order. Constraints: 1 <= n <= 10^5; positions are distinct.🔒
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!