title: Count Number Of Ways To Fill A N X 4 Grid Using 1 X 4 Tiles
signature: class Solution {
  
      public Long countNumberOfWaysToFillANX4GridUsing1X4Tiles(Integer n) {
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(61, 188941273L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(22, 657L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(65, 685792227L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(57, 52054840L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(36, 59864L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(25, 1728L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(16, 95L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(26, 2385L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(92, 4123691589365L);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(5, 3L);
          System.out.println(String.format("%s%s","TEST-9...",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
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 ];
  }