title: Count Possible Ways To Construct Buildings
signature: class Solution {
  
      public Long countPossibleWaysToConstructBuildings(Integer n) {
test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(Integer n, Long expected){
          try{
              Driver driver = new Driver();
              if (driver.run(n,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution(17, 17480761L);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution(34, 222915410843904L);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution(9, 7921L);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(Integer n, Long expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(n),expected);
      }
      
      public boolean validateSolution(Long actual, Long expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
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 );
  }