title: Count Ways Build Street Given Constraints
signature: function countWaysBuildStreetGivenConstraints(n: number): number {
source_py: def count_ways_build_street_given_constraints(n):
      dp = [([0] * (n + 1)) for i in range(2)]
      dp[0][1] = 1
      dp[1][1] = 2
      for i in range(2, (n + 1)):
          dp[0][i] = (dp[0][(i - 1)] + dp[1][(i - 1)])
          dp[1][i] = ((dp[0][(i - 1)] * 2) + dp[1][(i - 1)])
      return (dp[0][n] + dp[1][n])
source_cpp: long count_ways_build_street_given_constraints(int n) {
    long dp [ 2 ] [ n + 1 ];
    dp [ 0 ] [ 1 ] = 1;
    dp [ 1 ] [ 1 ] = 2;
    for ( int i = 2;
    i <= n;
    i ++ ) {
      dp [ 0 ] [ i ] = dp [ 0 ] [ i - 1 ] + dp [ 1 ] [ i - 1 ];
      dp [ 1 ] [ i ] = dp [ 0 ] [ i - 1 ] * 2 + dp [ 1 ] [ i - 1 ];
    }
    return dp [ 0 ] [ n ] + dp [ 1 ] [ n ];
  }
question_info.test_list: [{"idx": 0, "outputs": 54608393, "inputs": {"n": 20}}, {"idx": 1, "outputs": 3, "inputs": {"n": 1}}]
question_info.entry_cls_name: Solution
question_info.test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: number, expected: number): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(n: number, expected:number): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(n),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver(20, 54608393);
    console.log(`TEST-0...${result}`);
  
    result = driver(1, 3);
    console.log(`TEST-1...${result}`);
  
  };
  
  main();
question_info.extension: ts
question_info.entry_fn_name: countWaysBuildStreetGivenConstraints
question_info.test_case_ids: 0 1
question_info.commands: tsc --target es2020 --lib es5,dom,es2015,es2020 __FILENAME__
question_info.commands: node __FILENAME__.js