title: N Th Number Whose Sum Of Digits Is Ten
signature: function nThNumberWhoseSumOfDigitsIsTen(n: number): number {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": 406, "inputs": {"n": 37}}, {"idx": 1, "outputs": 136, "inputs": {"n": 13}}, {"idx": 2, "outputs": 613, "inputs": {"n": 51}}, {"idx": 3, "outputs": 1054, "inputs": {"n": 69}}, {"idx": 4, "outputs": 1126, "inputs": {"n": 76}}, {"idx": 5, "outputs": 109, "inputs": {"n": 10}}, {"idx": 6, "outputs": 1360, "inputs": {"n": 97}}, {"idx": 7, "outputs": 433, "inputs": {"n": 40}}, {"idx": 8, "outputs": 1054, "inputs": {"n": 69}}, {"idx": 9, "outputs": 46, "inputs": {"n": 4}}]
question_info.entry_cls_name: Solution
question_info.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(37, 406);
    console.log(`TEST-0...${result}`);
  
    result = driver(13, 136);
    console.log(`TEST-1...${result}`);
  
    result = driver(51, 613);
    console.log(`TEST-2...${result}`);
  
    result = driver(69, 1054);
    console.log(`TEST-3...${result}`);
  
    result = driver(76, 1126);
    console.log(`TEST-4...${result}`);
  
    result = driver(10, 109);
    console.log(`TEST-5...${result}`);
  
    result = driver(97, 1360);
    console.log(`TEST-6...${result}`);
  
    result = driver(40, 433);
    console.log(`TEST-7...${result}`);
  
    result = driver(69, 1054);
    console.log(`TEST-8...${result}`);
  
    result = driver(4, 46);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: nThNumberWhoseSumOfDigitsIsTen
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js