title: N Th Number Whose Sum Of Digits Is Ten
signature: fun nThNumberWhoseSumOfDigitsIsTen(n: Int): Int {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Int, expected:Int):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Int):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(37, 406)
      println("TEST-0...${result}")
      
      result = driver(13, 136)
      println("TEST-1...${result}")
      
      result = driver(51, 613)
      println("TEST-2...${result}")
      
      result = driver(69, 1054)
      println("TEST-3...${result}")
      
      result = driver(76, 1126)
      println("TEST-4...${result}")
      
      result = driver(10, 109)
      println("TEST-5...${result}")
      
      result = driver(97, 1360)
      println("TEST-6...${result}")
      
      result = driver(40, 433)
      println("TEST-7...${result}")
      
      result = driver(69, 1054)
      println("TEST-8...${result}")
      
      result = driver(4, 46)
      println("TEST-9...${result}")
      
          
  }
  
  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;
  }