title: Count Possible Ways To Construct Buildings
signature: long long countPossibleWaysToConstructBuildings(int n) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(long long actual, long long expected){
      return actual == expected;
  }
  
  string driver(int n, long long expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(17, 17480761); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(34, 222915410843904); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(9, 7921); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def count_possible_ways_to_construct_buildings(N):
      if (N == 1):
          return 4
      countB = 1
      countS = 1
      for i in range(2, (N + 1)):
          prev_countB = countB
          prev_countS = countS
          countS = (prev_countB + prev_countS)
          countB = prev_countS
      result = (countS + countB)
      return (result * result)
source_cpp: int count_possible_ways_to_construct_buildings(int N) {
    if ( N == 1 ) return 4;
    int countB = 1, countS = 1, prev_countB, prev_countS;
    for ( int i = 2;
    i <= N;
    i ++ ) {
      prev_countB = countB;
      prev_countS = countS;
      countS = prev_countB + prev_countS;
      countB = prev_countS;
    }
    int result = countS + countB;
    return ( result * result );
  }