title: Count Ways Build Street Given Constraints
signature: function count_ways_build_street_given_constraints(n)
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 ];
  }