title: Count Digits Factorial Set 2
signature: countDigitsFactorialSet2 :: Integer -> Integer
  countDigitsFactorialSet2 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 (56) (75) )
  
      printf "TEST-1...%s\n" (driver (92) (143) )
  
      printf "TEST-2...%s\n" (driver (52) (68) )
  
      printf "TEST-3...%s\n" (driver (96) (150) )
  
      printf "TEST-4...%s\n" (driver (96) (150) )
  
      printf "TEST-5...%s\n" (driver (63) (88) )
  
      printf "TEST-6...%s\n" (driver (51) (67) )
  
      printf "TEST-7...%s\n" (driver (79) (117) )
  
      printf "TEST-8...%s\n" (driver (70) (101) )
  
      printf "TEST-9...%s\n" (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;
  }