0. A long signal is written as two digits and always starts with a one: 10 or 11.
The tape pulses records several signals in a row, with no separators. The tape always ends with a zero, and there is exactly one way to split it into signals.
Return true if the last signal on the tape is short, and false if the final zero is the second half of a long signal.pulses=[1, 1, 0] → True
The tape reads only one way: 11 is a long signal, then 0 is a short one. The last signal is short.
pulses=[0, 1, 0] → False
First a short 0, then 10 is a long signal that swallows the final zero. The answer is false.
pulses=[0] → True
The only signal is a short 0.
pulses.length ≤ 1000pulses[i] is 0 or 1pulses is 0pulses=[1, 1, 0]
True
Run checks the first 3 tests in your browser. Submit checks all 97 tests on the server, hidden ones included.