Interview Question

Revision en2, by gXa, 2017-05-08 16:35:26

I got solutions on internet but it is quite difficult to understand. Plz can someone explain this.

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 N = 55, 110 is smallest multiple consisting of digits 0 and 1. For N = 2, 10 is the answer.

Tags bfs, 0-1 bfs, #graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English gXa 2017-05-08 16:35:26 23 Tiny change: 'he answer.\nSee Expected Output\n' -> 'he answer.'
en1 English gXa 2017-05-08 16:35:00 494 Initial revision (published)