title: Count Number Of Ways To Fill A N X 4 Grid Using 1 X 4 Tiles
signature: function count_number_of_ways_to_fill_a_n_x_4_grid_using_1_x_4_tiles(n)
source_py: def count_number_of_ways_to_fill_a_n_x_4_grid_using_1_x_4_tiles(n):
      dp = [0 for _ in range((n + 1))]
      for i in range(1, (n + 1)):
          if (i <= 3):
              dp[i] = 1
          elif (i == 4):
              dp[i] = 2
          else:
              dp[i] = (dp[(i - 1)] + dp[(i - 4)])
      return dp[n]
source_cpp: int count_number_of_ways_to_fill_a_n_x_4_grid_using_1_x_4_tiles(int n) {
    int dp [ n + 1 ];
    dp [ 0 ] = 0;
    for ( int i = 1;
    i <= n;
    i ++ ) {
      if ( i >= 1 && i <= 3 ) dp [ i ] = 1;
      else if ( i == 4 ) dp [ i ] = 2;
      else dp [ i ] = dp [ i - 1 ] + dp [ i - 4 ];
    }
    return dp [ n ];
  }
question_info.entry_fn_name: count_number_of_ways_to_fill_a_n_x_4_grid_using_1_x_4_tiles
question_info.entry_cls_name: Solution
question_info.test_case_ids: ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
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(61, 188941273)
      print(string.format("TEST-0...%s",result))
  
      result = driver(22, 657)
      print(string.format("TEST-1...%s",result))
  
      result = driver(65, 685792227)
      print(string.format("TEST-2...%s",result))
  
      result = driver(57, 52054840)
      print(string.format("TEST-3...%s",result))
  
      result = driver(36, 59864)
      print(string.format("TEST-4...%s",result))
  
      result = driver(25, 1728)
      print(string.format("TEST-5...%s",result))
  
      result = driver(16, 95)
      print(string.format("TEST-6...%s",result))
  
      result = driver(26, 2385)
      print(string.format("TEST-7...%s",result))
  
      result = driver(92, 4123691589365)
      print(string.format("TEST-8...%s",result))
  
      result = driver(5, 3)
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
question_info.test_list: [{"idx": 0, "outputs": 188941273, "inputs": {"n": 61}}, {"idx": 1, "outputs": 657, "inputs": {"n": 22}}, {"idx": 2, "outputs": 685792227, "inputs": {"n": 65}}, {"idx": 3, "outputs": 52054840, "inputs": {"n": 57}}, {"idx": 4, "outputs": 59864, "inputs": {"n": 36}}, {"idx": 5, "outputs": 1728, "inputs": {"n": 25}}, {"idx": 6, "outputs": 95, "inputs": {"n": 16}}, {"idx": 7, "outputs": 2385, "inputs": {"n": 26}}, {"idx": 8, "outputs": 4123691589365, "inputs": {"n": 92}}, {"idx": 9, "outputs": 3, "inputs": {"n": 5}}]