title: Count Fibonacci Numbers Given Range Log Time
signature: countFibonacciNumbersGivenRangeLogTime(low, high) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(int actual, int expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(low, high, int expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(low, high), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          76, 43, 
          0)
      }");
  
      print("TEST-1...${driver(
          96, 52, 
          0)
      }");
  
      print("TEST-2...${driver(
          19, 79, 
          3)
      }");
  
      print("TEST-3...${driver(
          36, 2, 
          0)
      }");
  
      print("TEST-4...${driver(
          60, 11, 
          0)
      }");
  
      print("TEST-5...${driver(
          20, 15, 
          0)
      }");
  
      print("TEST-6...${driver(
          76, 4, 
          0)
      }");
  
      print("TEST-7...${driver(
          63, 93, 
          1)
      }");
  
      print("TEST-8...${driver(
          2, 25, 
          6)
      }");
  
      print("TEST-9...${driver(
          41, 39, 
          0)
      }");
  
      return 0;
  }
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;
  }