title: N Th Number Whose Sum Of Digits Is Ten
signature: function n_th_number_whose_sum_of_digits_is_ten(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(37, 406);
      @printf("TEST-0...%s\n",result);
      
      result = driver(13, 136);
      @printf("TEST-1...%s\n",result);
      
      result = driver(51, 613);
      @printf("TEST-2...%s\n",result);
      
      result = driver(69, 1054);
      @printf("TEST-3...%s\n",result);
      
      result = driver(76, 1126);
      @printf("TEST-4...%s\n",result);
      
      result = driver(10, 109);
      @printf("TEST-5...%s\n",result);
      
      result = driver(97, 1360);
      @printf("TEST-6...%s\n",result);
      
      result = driver(40, 433);
      @printf("TEST-7...%s\n",result);
      
      result = driver(69, 1054);
      @printf("TEST-8...%s\n",result);
      
      result = driver(4, 46);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def n_th_number_whose_sum_of_digits_is_ten(n):
      count = 0
      for curr in itertools.count():
          sum = 0
          x = curr
          while x:
              sum = (sum + (x % 10))
              x = (x // 10)
          if (sum == 10):
              count = (count + 1)
          if (count == n):
              return curr
      return (- 1)
source_cpp: int n_th_number_whose_sum_of_digits_is_ten(int n) {
    int count = 0;
    for ( int curr = 1;
    ;
    curr ++ ) {
      int sum = 0;
      for ( int x = curr;
      x > 0;
      x = x / 10 ) sum = sum + x % 10;
      if ( sum == 10 ) count ++;
      if ( count == n ) return curr;
    }
    return - 1;
  }