1D Players and Watcher With Direction Changes

Problem: 1D Players and a Watcher With Direction Switches

On a 1D line segment from 0 to L, there are N players with initial positions pos[i] (0 <= pos[i] <= L). Every player **attempts ...

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: