title: Count Factorial Numbers In A Given Range
signature: count_factorial_numbers_in_a_given_range <- function(low, high) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(low, high, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(low, high), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          57L, 79L, 
          0L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          57L, 21L, 
          0L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          31L, 37L, 
          0L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          62L, 87L, 
          0L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          49L, 98L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          82L, 76L, 
          0L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          31L, 45L, 
          0L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          5L, 52L, 
          2L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          76L, 43L, 
          0L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          55L, 6L, 
          0L
      )))
  
  }
  
  main()
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;
  }