title: N Th Number Whose Sum Of Digits Is Ten 2
signature: func nThNumberWhoseSumOfDigitsIsTen2(n int) int {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual int, expected int) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(n int, expected int) string {
      if validateSolution(PLACEHOLDER_FN_NAME(n),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver(68, 631)
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver(70, 649)
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver(69, 640)
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver(93, 856)
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver(99, 910)
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver(44, 415)
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver(91, 838)
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver(8, 82)
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver(83, 766)
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver(51, 478)
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }