title: Count Digits Factorial Set 1
signature: pub fn count_digits_factorial_set_1(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        66, 
        93
      ));
      
      println!("TEST-1...{}", driver(
        7, 
        4
      ));
      
      println!("TEST-2...{}", driver(
        55, 
        74
      ));
      
      println!("TEST-3...{}", driver(
        37, 
        44
      ));
      
      println!("TEST-4...{}", driver(
        76, 
        112
      ));
      
      println!("TEST-5...{}", driver(
        16, 
        14
      ));
      
      println!("TEST-6...{}", driver(
        17, 
        15
      ));
      
      println!("TEST-7...{}", driver(
        95, 
        149
      ));
      
      println!("TEST-8...{}", driver(
        71, 
        102
      ));
      
      println!("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;
  }