title: Count Digits Factorial Set 1
signature: def countDigitsFactorialSet1(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(
        66, 
        93    
      )}")   
  
  
      println(s"TEST-1...${driver(
        7, 
        4    
      )}")   
  
  
      println(s"TEST-2...${driver(
        55, 
        74    
      )}")   
  
  
      println(s"TEST-3...${driver(
        37, 
        44    
      )}")   
  
  
      println(s"TEST-4...${driver(
        76, 
        112    
      )}")   
  
  
      println(s"TEST-5...${driver(
        16, 
        14    
      )}")   
  
  
      println(s"TEST-6...${driver(
        17, 
        15    
      )}")   
  
  
      println(s"TEST-7...${driver(
        95, 
        149    
      )}")   
  
  
      println(s"TEST-8...${driver(
        71, 
        102    
      )}")   
  
  
      println(s"TEST-9...${driver(
        90, 
        139    
      )}")   
  
  }
  
source_py: def count_digits_factorial_set_1(n):
      if (n < 0):
          return 0
      if (n <= 1):
          return 1
      digits = 0
      for i in range(2, (n + 1)):
          digits += math.log10(i)
      return (math.floor(digits) + 1)
source_cpp: int count_digits_factorial_set_1(int n) {
    if ( n < 0 ) return 0;
    if ( n <= 1 ) return 1;
    double digits = 0;
    for ( int i = 2;
    i <= n;
    i ++ ) digits += log10 ( i );
    return floor ( digits ) + 1;
  }