Leetcode 2751. Robot Collisions
Given robots with positions, healths and L/R directions that move simultaneously and collide when opposite-moving robots meet—where the lower-health robot is removed and the survivor loses one health (ties remove both)—return the final healths of surviving robots in the original order. The core challenge is to simulate pairwise R vs L collisions efficiently by sorting by position and using a stack to resolve successive collisions and health updates.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.