title: find smallest number divisible by N with sum of digits as N
body: <p>For a given number N(0&lt;N&lt;=100) find out the minimum positive integer X divisible by N, where the sum of digits of X is equal to N, and X is not equal to N.</p>
  <pre class="lang-java prettyprint-override"><code>public static int getSmallestNumber(int input1) {
      int res =0;
      for(int i=2;i&lt;10000;i++) {
          if(getSum(input1*i) == input1) {
          res = input1*i;
              break;
          }
              
      }
      return res;
  }
  
  static int getSum(int n) {    
      int sum = 0;
      while (n != 0) {
          sum = sum + n % 10;
          n = n/10;
      }
      return sum;
  }
  </code></pre>
  <p>Example: Input: 9
  output: 18
  Explanation: 1+8 is 9 and 18 is divisible by 9</p>
  <p>Example2: Input: 10
  output: 190
  Explanation: 1+9+0 is 10 and 190 is divisible by 10</p>
  <p>My solution works for smaller integer but breaks for larger numbers like 98, 99 or 100.</p>