title: Count Factorial Numbers In A Given Range
signature: function count_factorial_numbers_in_a_given_range(low, high)
test_code: using Printf
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  function validate_solution(actual, expected)
      return actual == expected
  end
  
  function driver(low, high, expected)
      try
  
          if validate_solution(PLACEHOLDER_FN_NAME(low, high), expected)
              return "PASSED";
          end
          return "FAILED";
      catch exception_obj
          return string(Base.typename(typeof(exception_obj)).wrapper);
      end
  end
  
  function main()
      
      result = driver(57, 79, 0);
      @printf("TEST-0...%s\n",result);
      
      result = driver(57, 21, 0);
      @printf("TEST-1...%s\n",result);
      
      result = driver(31, 37, 0);
      @printf("TEST-2...%s\n",result);
      
      result = driver(62, 87, 0);
      @printf("TEST-3...%s\n",result);
      
      result = driver(49, 98, 0);
      @printf("TEST-4...%s\n",result);
      
      result = driver(82, 76, 0);
      @printf("TEST-5...%s\n",result);
      
      result = driver(31, 45, 0);
      @printf("TEST-6...%s\n",result);
      
      result = driver(5, 52, 2);
      @printf("TEST-7...%s\n",result);
      
      result = driver(76, 43, 0);
      @printf("TEST-8...%s\n",result);
      
      result = driver(55, 6, 0);
      @printf("TEST-9...%s\n",result);
      
  end
  
  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;
  }