title: Count Ways Build Street Given Constraints
signature: pub fn count_ways_build_street_given_constraints(n: i32) -> i32 {
test_code: use std::collections::HashMap;
  use std::collections::HashSet;
  use std::cmp::*;
  use std::collections::*;
  use std::fmt::*; 
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  pub fn validate_solution(actual: i32, expected: i32)->bool{
  return actual==expected
  }
  pub fn driver(n: i32, expected: i32)->String{
      if validate_solution(PLACEHOLDER_FN_NAME(n), expected) {
        return "PASSED".to_string();
      };
      return "FAILED".to_string();
  
  }
  
  fn main() {
      println!("TEST-0...{}", driver(
        20, 
        54608393
      ));
      
      println!("TEST-1...{}", driver(
        1, 
        3
      ));
      
  }
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 ];
  }