digits. The numbers were in non-decreasing order (each one at least as large as the one before it), and none of them started with a zero.
Count how many different lists of numbers could have produced this string. A list with a single number counts too. The answer can be large, so return it modulo 10⁹ + 7.digits="1210" → 3
Three readings work: 1210; 1, 210; and 1, 2, 10. The split 12, 10 fails because 12 is larger than 10.
digits="5402" → 2
5402 and 5, 402 work. 54, 02 has a leading zero, and 540, 2 is decreasing.
digits="07" → 0
Every reading starts with a number that has a leading zero, so there are none.
len(digits) ≤ 3500digits consists of the digits 0 to 9digits="1210"
3
Run checks the first 3 tests in your browser. Submit checks all 108 tests on the server, hidden ones included.