title: Tiling With Dominoes
signature: pub fn tiling_with_dominoes(n: i32) -> i64 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i64, expected: i64)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i64)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        29, 
        0
      ));
      
      println!("TEST-1...{}", driver(
        13, 
        0
      ));
      
      println!("TEST-2...{}", driver(
        25, 
        0
      ));
      
      println!("TEST-3...{}", driver(
        65, 
        0
      ));
      
      println!("TEST-4...{}", driver(
        27, 
        0
      ));
      
      println!("TEST-5...{}", driver(
        42, 
        808717138331
      ));
      
      println!("TEST-6...{}", driver(
        19, 
        0
      ));
      
      println!("TEST-7...{}", driver(
        50, 
        156886956080403
      ));
      
      println!("TEST-8...{}", driver(
        59, 
        0
      ));
      
      println!("TEST-9...{}", driver(
        13, 
        0
      ));
      
  }
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 ];
  }