title: Count Number Binary Strings Without Consecutive 1S
signature: count_number_binary_strings_without_consecutive_1s <- function(n) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(n, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(n), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          75L, 
          5527939700884757L
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          14L, 
          987L
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          5L, 
          13L
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          41L, 
          433494437L
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          35L, 
          24157817L
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          30L, 
          2178309L
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          84L, 
          420196140727489673L
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          53L, 
          139583862445L
      )))
  
  }
  
  main()
source_py: def count_number_binary_strings_without_consecutive_1s(n):
      a = [0 for i in range(n)]
      b = [0 for i in range(n)]
      a[0] = b[0] = 1
      for i in range(1, n):
          a[i] = (a[(i - 1)] + b[(i - 1)])
          b[i] = a[(i - 1)]
      return (a[(n - 1)] + b[(n - 1)])
source_cpp: int count_number_binary_strings_without_consecutive_1s(int n) {
    int a [ n ], b [ n ];
    a [ 0 ] = b [ 0 ] = 1;
    for ( int i = 1;
    i < n;
    i ++ ) {
      a [ i ] = a [ i - 1 ] + b [ i - 1 ];
      b [ i ] = a [ i - 1 ];
    }
    return a [ n - 1 ] + b [ n - 1 ];
  }