title: Count Fibonacci Numbers Given Range Log Time
signature: function countFibonacciNumbersGivenRangeLogTime(low: number, high: number): number {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(low: number, high: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(low, high),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(76, 43, 0);
    console.log(`TEST-0...${result}`);
  
    result = driver(96, 52, 0);
    console.log(`TEST-1...${result}`);
  
    result = driver(19, 79, 3);
    console.log(`TEST-2...${result}`);
  
    result = driver(36, 2, 0);
    console.log(`TEST-3...${result}`);
  
    result = driver(60, 11, 0);
    console.log(`TEST-4...${result}`);
  
    result = driver(20, 15, 0);
    console.log(`TEST-5...${result}`);
  
    result = driver(76, 4, 0);
    console.log(`TEST-6...${result}`);
  
    result = driver(63, 93, 1);
    console.log(`TEST-7...${result}`);
  
    result = driver(2, 25, 6);
    console.log(`TEST-8...${result}`);
  
    result = driver(41, 39, 0);
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def count_fibonacci_numbers_given_range_log_time(low, high):
      (f1, f2, f3) = (0, 1, 1)
      result = 0
      while (f1 <= high):
          if (f1 >= low):
              result += 1
          f1 = f2
          f2 = f3
          f3 = (f1 + f2)
      return result
source_cpp: int count_fibonacci_numbers_given_range_log_time(int low, int high) {
    int f1 = 0, f2 = 1, f3 = 1;
    int result = 0;
    while ( f1 <= high ) {
      if ( f1 >= low ) result ++;
      f1 = f2;
      f2 = f3;
      f3 = f1 + f2;
    }
    return result;
  }