title: Count Digits Factorial Set 2
signature: fun countDigitsFactorialSet2(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(56, 75)
      println("TEST-0...${result}")
      
      result = driver(92, 143)
      println("TEST-1...${result}")
      
      result = driver(52, 68)
      println("TEST-2...${result}")
      
      result = driver(96, 150)
      println("TEST-3...${result}")
      
      result = driver(96, 150)
      println("TEST-4...${result}")
      
      result = driver(63, 88)
      println("TEST-5...${result}")
      
      result = driver(51, 67)
      println("TEST-6...${result}")
      
      result = driver(79, 117)
      println("TEST-7...${result}")
      
      result = driver(70, 101)
      println("TEST-8...${result}")
      
      result = driver(9, 6)
      println("TEST-9...${result}")
      
          
  }
  
  main()
source_py: def count_digits_factorial_set_2(n):
      if (n < 0):
          return 0
      if (n <= 1):
          return 1
      x = ((n * math.log10((n / math.e))) + (math.log10(((2 * math.pi) * n)) / 2.0))
      return (math.floor(x) + 1)
source_cpp: long long count_digits_factorial_set_2(int n) {
    if ( n < 0 ) return 0;
    if ( n <= 1 ) return 1;
    double x = ( ( n * log10 ( n / M_E ) + log10 ( 2 * M_PI * n ) / 2.0 ) );
    return floor ( x ) + 1;
  }