← All problemsSign in

Last Car Standing

``` "Either you're Big Neer or you're wrong, ``` ``` Can't say about the testcases but you certainly are strong." ``` \- Li'l Push Far far behind the jungles of Sabar, is a horizontal bridge of length $l$ with $n$ cars on it. The bridge has integer positions marked from $0$ to $l$. Each car is initially at any one of the positions and has a direction (left/right). All cars always move at the spee

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start