bits are appended one at a time to the right end of a display. After each new digit, the display shows the binary number formed by all digits so far (most significant on the left).
Return a list of booleans of the same length whose i-th item is True if the number on the display after digit i is divisible by 5, and False otherwise. The numbers can get very long.bits=[1, 0, 1, 0] → [False, False, True, True]
The board shows 1, 10, 101, 1010 in turn, which are 1, 2, 5, 10. The last two are multiples of 5.
bits=[0, 1, 1] → [True, False, False]
The numbers are 0, 1, 3. Zero is a multiple of 5, the others are not.
bits.length ≤ 5·10⁵bits[i] is 0 or 1bits=[1, 0, 1, 0]
[False, False, True, True]
Run checks the first 3 tests in your browser. Submit checks all 71 tests on the server, hidden ones included.