title: Tiling With Dominoes
signature: function tilingWithDominoes($n) {
test_code: <?php
  
  
  // SOLUTION CODE 
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function validateSolution($actual, $expected){
      return serialize($actual) == serialize($expected);
  }
  
  function driver($n, $expected){
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME($n), $expected)){
          return "PASSED";
        }
        return "FAILED";
      }
      catch (Exception $exception_obj) {
        return get_class($exception_obj);
      }
  }
  
  function main(){
      printf("TEST-0...%s\n",driver(
        29, 
        0));
      
      printf("TEST-1...%s\n",driver(
        13, 
        0));
      
      printf("TEST-2...%s\n",driver(
        25, 
        0));
      
      printf("TEST-3...%s\n",driver(
        65, 
        0));
      
      printf("TEST-4...%s\n",driver(
        27, 
        0));
      
      printf("TEST-5...%s\n",driver(
        42, 
        808717138331));
      
      printf("TEST-6...%s\n",driver(
        19, 
        0));
      
      printf("TEST-7...%s\n",driver(
        50, 
        156886956080403));
      
      printf("TEST-8...%s\n",driver(
        59, 
        0));
      
      printf("TEST-9...%s\n",driver(
        13, 
        0));
      
  }
  
  main();
  ?>
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 ];
  }