title: N Th Number Whose Sum Of Digits Is Ten 1
signature: function nThNumberWhoseSumOfDigitsIsTen1(n: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(93, 1324);
    console.log(`TEST-0...${result}`);
  
    result = driver(10, 109);
    console.log(`TEST-1...${result}`);
  
    result = driver(55, 703);
    console.log(`TEST-2...${result}`);
  
    result = driver(94, 1333);
    console.log(`TEST-3...${result}`);
  
    result = driver(2, 28);
    console.log(`TEST-4...${result}`);
  
    result = driver(5, 55);
    console.log(`TEST-5...${result}`);
  
    result = driver(37, 406);
    console.log(`TEST-6...${result}`);
  
    result = driver(4, 46);
    console.log(`TEST-7...${result}`);
  
    result = driver(11, 118);
    console.log(`TEST-8...${result}`);
  
    result = driver(46, 523);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
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;
  }