bits of 0 and 1 characters. A binary number can be written out of it by crossing out any characters (possibly none) while keeping the order of the rest, as long as at least one character stays.
Such a record is proper if it has no leading zeros: it either starts with 1 or is exactly "0".
Return how many different proper records can be obtained this way, modulo 10⁹ + 7.bits='110' → 5
The numbers 1, 0, 11, 10 and 110 can be written out: five distinct ones.
bits='0010' → 3
Without leading zeros only 0, 1 and 10 are possible.
bits='000' → 1
bits) ≤ 10⁵bits consists only of '0' and '1'bits='110'
5
Run checks the first 3 tests in your browser. Submit checks all 93 tests on the server, hidden ones included.