title: N Th Number Whose Sum Of Digits Is Ten 2
signature: function n_th_number_whose_sum_of_digits_is_ten_2(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(68, 631);
      @printf("TEST-0...%s\n",result);
      
      result = driver(70, 649);
      @printf("TEST-1...%s\n",result);
      
      result = driver(69, 640);
      @printf("TEST-2...%s\n",result);
      
      result = driver(93, 856);
      @printf("TEST-3...%s\n",result);
      
      result = driver(99, 910);
      @printf("TEST-4...%s\n",result);
      
      result = driver(44, 415);
      @printf("TEST-5...%s\n",result);
      
      result = driver(91, 838);
      @printf("TEST-6...%s\n",result);
      
      result = driver(8, 82);
      @printf("TEST-7...%s\n",result);
      
      result = driver(83, 766);
      @printf("TEST-8...%s\n",result);
      
      result = driver(51, 478);
      @printf("TEST-9...%s\n",result);
      
  end
  
  main()
source_py: def n_th_number_whose_sum_of_digits_is_ten_2(n):
      nthElement = (19 + ((n - 1) * 9))
      outliersCount = (int(math.log10(nthElement)) - 1)
      nthElement += (9 * outliersCount)
      return nthElement
source_cpp: int n_th_number_whose_sum_of_digits_is_ten_2(int n) {
    int nthElement = 19 + ( n - 1 ) * 9;
    int outliersCount = ( int ) log10 ( nthElement ) - 1;
    nthElement += 9 * outliersCount;
    return nthElement;
  }