title: Count Strings With Consecutive 1S
signature: function count_strings_with_consecutive_1s(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.entry_fn_name: count_strings_with_consecutive_1s
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6']
question_info.test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(n, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(n) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver(27, 133703499)
      print(string.format("TEST-0...%s",result))
  
      result = driver(13, 7582)
      print(string.format("TEST-1...%s",result))
  
      result = driver(33, 8580707127)
      print(string.format("TEST-2...%s",result))
  
      result = driver(57, 144114231353829831)
      print(string.format("TEST-3...%s",result))
  
      result = driver(51, 2251746497394075)
      print(string.format("TEST-4...%s",result))
  
      result = driver(10, 880)
      print(string.format("TEST-5...%s",result))
  
      result = driver(1, 0)
      print(string.format("TEST-6...%s",result))
  
  end
  
  main()
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}}]