title: N Th Number Whose Sum Of Digits Is Ten
signature: pub fn n_th_number_whose_sum_of_digits_is_ten(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        37, 
        406
      ));
      
      println!("TEST-1...{}", driver(
        13, 
        136
      ));
      
      println!("TEST-2...{}", driver(
        51, 
        613
      ));
      
      println!("TEST-3...{}", driver(
        69, 
        1054
      ));
      
      println!("TEST-4...{}", driver(
        76, 
        1126
      ));
      
      println!("TEST-5...{}", driver(
        10, 
        109
      ));
      
      println!("TEST-6...{}", driver(
        97, 
        1360
      ));
      
      println!("TEST-7...{}", driver(
        40, 
        433
      ));
      
      println!("TEST-8...{}", driver(
        69, 
        1054
      ));
      
      println!("TEST-9...{}", driver(
        4, 
        46
      ));
      
  }
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;
  }