lamps describes them from left to right: '1' means the lamp is on, '0' means it is off. The first lamp is always on.
Return True if all the lit lamps form one unbroken stretch, and False if some unlit lamp sits between lit ones.lamps="111000" → True
The first three lamps are lit in a row and the rest are off: one stretch.
lamps="1101" → False
An unlit lamp sits between lit ones, so there are two stretches.
lamps="1" → True
lamps is '0' or '1'lamps[0] == '1'lamps="111000"
True
Run checks the first 3 tests in your browser. Submit checks all 110 tests on the server, hidden ones included.