title: Tiling With Dominoes
signature: class Solution {
  
      public Long tilingWithDominoes(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(29, 0L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(13, 0L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(25, 0L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution(65, 0L);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution(27, 0L);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution(42, 808717138331L);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution(19, 0L);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution(50, 156886956080403L);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution(59, 0L);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution(13, 0L);
          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 tiling_with_dominoes(n):
      A = ([0] * (n + 1))
      B = ([0] * (n + 1))
      A[0] = 1
      A[1] = 0
      B[0] = 0
      B[1] = 1
      for i in range(2, (n + 1)):
          A[i] = (A[(i - 2)] + (2 * B[(i - 1)]))
          B[i] = (A[(i - 1)] + B[(i - 2)])
      return A[n]
source_cpp: int tiling_with_dominoes(int n) {
    int A [ n + 1 ], B [ n + 1 ];
    A [ 0 ] = 1, A [ 1 ] = 0, B [ 0 ] = 0, B [ 1 ] = 1;
    for ( int i = 2;
    i <= n;
    i ++ ) {
      A [ i ] = A [ i - 2 ] + 2 * B [ i - 1 ];
      B [ i ] = A [ i - 1 ] + B [ i - 2 ];
    }
    return A [ n ];
  }