Search
⌘K
Leetcode 1015. Smallest Integer Divisible by K
Find the minimum length L such that the repunit (a number consisting of L copies of digit '1') is divisible by k, returning -1 if no such repunit exists (no solution when k has factor 2 or 5). The core challenge is detecting divisibility by tracking remainders/cycles rather than constructing the huge number.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.