start and an integer divisor. Call a number **zero-free** if its decimal notation contains no digit 0.
Find the smallest zero-free number that is at least start and whose product of digits is divisible by divisor. Return it as a string. If no such number exists, return "-1".start="1500", divisor=36 → '1549'
For a number 15xy we need 5·x·y to be a multiple of 36, so x·y must be a multiple of 36; the smallest such ending is 49. The answer is 1549: 1·5·4·9 = 180 = 36 · 5.
start="2357", divisor=10 → '2357'
2·3·5·7 = 210 is already a multiple of 10 and there are no zeros, so the number itself is the answer.
start="99", divisor=22 → '-1'
22 = 2 · 11, and no digit contributes a factor of 11, so the answer is "-1".
len(start) ≤ 2 · 10⁵start consists of digits and does not begin with 0divisor ≤ 10¹⁴start="1500", divisor=36
'1549'
Run checks the first 3 tests in your browser. Submit checks all 96 tests on the server, hidden ones included.