digits made of decimal digits and a positive integer divisor. For every position i, read the prefix digits[0..i] as a decimal number (leading zeros are fine) and check whether it is divisible by divisor.
Return a list as long as digits: position i holds 1 if the prefix of length i + 1 is divisible by divisor, and 0 otherwise.digits="1236", divisor=4 → [0, 1, 0, 1]
The prefixes are 1, 12, 123 and 1236. Of these, 12 and 1236 are divisible by 4.
digits="0705", divisor=7 → [1, 1, 1, 0]
The prefixes "0", "07" and "070" are the numbers 0, 7 and 70, all divisible by 7. But 705 = 7 · 100 + 5 is not.
digits consists of the digits 0–9digits="1236", divisor=4
[0, 1, 0, 1]
Run checks the first 3 tests in your browser. Submit checks all 8 tests on the server, hidden ones included.