title: Count Digits Factorial Set 2
signature: function count_digits_factorial_set_2(n)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(n, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(n), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(56, 75);
      @printf("TEST-0...%s\n",result);
      
      result = driver(92, 143);
      @printf("TEST-1...%s\n",result);
      
      result = driver(52, 68);
      @printf("TEST-2...%s\n",result);
      
      result = driver(96, 150);
      @printf("TEST-3...%s\n",result);
      
      result = driver(96, 150);
      @printf("TEST-4...%s\n",result);
      
      result = driver(63, 88);
      @printf("TEST-5...%s\n",result);
      
      result = driver(51, 67);
      @printf("TEST-6...%s\n",result);
      
      result = driver(79, 117);
      @printf("TEST-7...%s\n",result);
      
      result = driver(70, 101);
      @printf("TEST-8...%s\n",result);
      
      result = driver(9, 6);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }