title: Count Factorial Numbers In A Given Range
signature: def countFactorialNumbersInAGivenRange(low: Int, high: 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(low: Int, high: Int, expected: Int): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(low, high),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        57, 79, 
        0    
      )}")   
  
  
      println(s"TEST-1...${driver(
        57, 21, 
        0    
      )}")   
  
  
      println(s"TEST-2...${driver(
        31, 37, 
        0    
      )}")   
  
  
      println(s"TEST-3...${driver(
        62, 87, 
        0    
      )}")   
  
  
      println(s"TEST-4...${driver(
        49, 98, 
        0    
      )}")   
  
  
      println(s"TEST-5...${driver(
        82, 76, 
        0    
      )}")   
  
  
      println(s"TEST-6...${driver(
        31, 45, 
        0    
      )}")   
  
  
      println(s"TEST-7...${driver(
        5, 52, 
        2    
      )}")   
  
  
      println(s"TEST-8...${driver(
        76, 43, 
        0    
      )}")   
  
  
      println(s"TEST-9...${driver(
        55, 6, 
        0    
      )}")   
  
  }
  
source_py: def count_factorial_numbers_in_a_given_range(low, high):
      fact = 1
      x = 1
      while (fact < low):
          fact = (fact * x)
          x += 1
      res = 0
      while (fact <= high):
          res += 1
          fact = (fact * x)
          x += 1
      return res
source_cpp: int count_factorial_numbers_in_a_given_range(int low, int high) {
    int fact = 1, x = 1;
    while ( fact < low ) {
      fact = fact * x;
      x ++;
    }
    int res = 0;
    while ( fact <= high ) {
      res ++;
      fact = fact * x;
      x ++;
    }
    return res;
  }