title: Count Digits Factorial Set 1
signature: countDigitsFactorialSet1 :: Integer -> Integer
  countDigitsFactorialSet1 n = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: Integer -> Integer -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: Integer -> Integer -> String
  driver n expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME n) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver (66) (93) )
  
      printf "TEST-1...%s\n" (driver (7) (4) )
  
      printf "TEST-2...%s\n" (driver (55) (74) )
  
      printf "TEST-3...%s\n" (driver (37) (44) )
  
      printf "TEST-4...%s\n" (driver (76) (112) )
  
      printf "TEST-5...%s\n" (driver (16) (14) )
  
      printf "TEST-6...%s\n" (driver (17) (15) )
  
      printf "TEST-7...%s\n" (driver (95) (149) )
  
      printf "TEST-8...%s\n" (driver (71) (102) )
  
      printf "TEST-9...%s\n" (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;
  }