← VMware questions

Smallest number divisible by k of form 1, 11, 111...

Filed under VMware

Given a positive integer `k`, find the length of the smallest positive integer `n` consisting only of the digit 1 (such as 1, 11, 111, ...) that is divisible by `k`. Return -1 if no such integer…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related VMware questions

Collected from public candidate posts and coding forums. Updated Nov 2026.