title: Count Strings With Consecutive 1S
signature: class Solution {
  
      public Long countStringsWithConsecutive1S(Integer n) {
source_py: def count_strings_with_consecutive_1s(n):
      a = ([0] * n)
      b = ([0] * 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 (((1 << n) - a[(n - 1)]) - b[(n - 1)])
source_cpp: int count_strings_with_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 ( 1 << n ) - a [ n - 1 ] - b [ n - 1 ];
  }
question_info.extension: java
question_info.entry_fn_name: countStringsWithConsecutive1S
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": 133703499, "inputs": {"n": 27}}, {"idx": 1, "outputs": 7582, "inputs": {"n": 13}}, {"idx": 2, "outputs": 8580707127, "inputs": {"n": 33}}, {"idx": 3, "outputs": 144114231353829831, "inputs": {"n": 57}}, {"idx": 4, "outputs": 2251746497394075, "inputs": {"n": 51}}, {"idx": 5, "outputs": 880, "inputs": {"n": 10}}, {"idx": 6, "outputs": 0, "inputs": {"n": 1}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(27, 133703499L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(13, 7582L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(33, 8580707127L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(57, 144114231353829831L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(51, 2251746497394075L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(10, 880L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(1, 0L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6
question_info.commands: java __FILENAME__