title: Tiling With Dominoes
signature: fun tilingWithDominoes(n: Int): Long {
test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Long, expected:Long):Boolean{
    return actual.equals(expected)
  }
  fun driver(n: Int, expected:Long):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver(29, 0)
      println("TEST-0...${result}")
      
      result = driver(13, 0)
      println("TEST-1...${result}")
      
      result = driver(25, 0)
      println("TEST-2...${result}")
      
      result = driver(65, 0)
      println("TEST-3...${result}")
      
      result = driver(27, 0)
      println("TEST-4...${result}")
      
      result = driver(42, 808717138331)
      println("TEST-5...${result}")
      
      result = driver(19, 0)
      println("TEST-6...${result}")
      
      result = driver(50, 156886956080403)
      println("TEST-7...${result}")
      
      result = driver(59, 0)
      println("TEST-8...${result}")
      
      result = driver(13, 0)
      println("TEST-9...${result}")
      
          
  }
  
  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 ];
  }