Simplified Asteroid Collision

You are given a sequence of moving objects represented by integers:

  • positive: moving right, negative: moving left
  • absolute value: size

A collision can happen only when a right-moving object meets...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: