Smallest Multiple With 0 and 1

You are given an integer N. You have to find smallest multiple of N which consists of digits 0 and 1 only. Since this multiple could be large, return it in form of a string.

Note:
- Returned string should not contain leading zeroes.

For example,

For N = 55, 110 is smallest multiple consisting of digits 0 and 1.
For N = 2, 10 is the answer.
Interview Code Editor
Hints
  • Hint 1
  • Solution Approach
  • Complete Solution
607 successful submissions.
Asked In:
  • Amazon
Click here to jump start your coding interview preparation