title: Tiling With Dominoes
signature: def tilingWithDominoes(n: Int) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: Long , expected: Long): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(n: Int, expected: Long): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        29, 
        0L    
      )}")   
  
  
      println(s"TEST-1...${driver(
        13, 
        0L    
      )}")   
  
  
      println(s"TEST-2...${driver(
        25, 
        0L    
      )}")   
  
  
      println(s"TEST-3...${driver(
        65, 
        0L    
      )}")   
  
  
      println(s"TEST-4...${driver(
        27, 
        0L    
      )}")   
  
  
      println(s"TEST-5...${driver(
        42, 
        808717138331L    
      )}")   
  
  
      println(s"TEST-6...${driver(
        19, 
        0L    
      )}")   
  
  
      println(s"TEST-7...${driver(
        50, 
        156886956080403L    
      )}")   
  
  
      println(s"TEST-8...${driver(
        59, 
        0L    
      )}")   
  
  
      println(s"TEST-9...${driver(
        13, 
        0L    
      )}")   
  
  }
  
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 ];
  }