title: N Th Number Whose Sum Of Digits Is Ten 1
signature: class Solution {
  
      public Integer nThNumberWhoseSumOfDigitsIsTen1(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Integer expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(93, 1324);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(10, 109);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(55, 703);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(94, 1333);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(2, 28);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(5, 55);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(37, 406);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(4, 46);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(11, 118);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(46, 523);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Integer expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Integer actual, Integer expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
source_py: def n_th_number_whose_sum_of_digits_is_ten_1(n):
      count = 0
      curr = 19
      while True:
          sum = 0
          x = curr
          while (x > 0):
              sum = (sum + (x % 10))
              x = int((x / 10))
          if (sum == 10):
              count += 1
          if (count == n):
              return curr
          curr += 9
      return (- 1)
source_cpp: int n_th_number_whose_sum_of_digits_is_ten_1(int n) {
    int count = 0;
    for ( int curr = 19;
    ;
    curr += 9 ) {
      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;
  }