title: Count Fibonacci Numbers Given Range Log Time
signature: count_fibonacci_numbers_given_range_log_time <- 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(
          76L, 43L, 
          0L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          96L, 52L, 
          0L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          19L, 79L, 
          3L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          36L, 2L, 
          0L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          60L, 11L, 
          0L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          20L, 15L, 
          0L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          76L, 4L, 
          0L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          63L, 93L, 
          1L
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          2L, 25L, 
          6L
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          41L, 39L, 
          0L
      )))
  
  }
  
  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;
  }