title: Count Digits Factorial Set 2
signature: def countDigitsFactorialSet2(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Int , expected: Int): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        56, 
        75    
      )}")   
  
  
      println(s"TEST-1...${driver(
        92, 
        143    
      )}")   
  
  
      println(s"TEST-2...${driver(
        52, 
        68    
      )}")   
  
  
      println(s"TEST-3...${driver(
        96, 
        150    
      )}")   
  
  
      println(s"TEST-4...${driver(
        96, 
        150    
      )}")   
  
  
      println(s"TEST-5...${driver(
        63, 
        88    
      )}")   
  
  
      println(s"TEST-6...${driver(
        51, 
        67    
      )}")   
  
  
      println(s"TEST-7...${driver(
        79, 
        117    
      )}")   
  
  
      println(s"TEST-8...${driver(
        70, 
        101    
      )}")   
  
  
      println(s"TEST-9...${driver(
        9, 
        6    
      )}")   
  
  }
  
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;
  }