comefrom: <awangdev>Best Time to Buy and Sell Stock with Cooldown_1.java
code: public int maxProfit(int[] prices) {
          if (prices == null || prices.length <= 1) {
              return 0;
          }
          int n = prices.length;
          int[][] dp = new int[n][2];
          dp[0][0] = - prices[0]; 
          dp[0][1] = 0; 
          
          for (int i = 1; i < n; i++) {
              
              dp[i][1] = Math.max(dp[i - 1][1], dp[i - 1][0] + prices[i]);
              
              dp[i][0] = dp[i - 1][0];
              if (i >= 2) {
                  dp[i][0] = Math.max(dp[i][0], dp[i - 2][1] - prices[i]);
              } else {
                  dp[i][0] = Math.max(dp[i][0], - prices[i]);
              }
          }
          
          return dp[n - 1][1];
      }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 == null || var_0 . length <= 1 ) {
      return 0 ;
    }
    int var_1 = var_0 . length ;
    int [ ] [ ] var_2 = new int [ var_1 ] [ 2 ] ;
    var_2 [ 0 ] [ 0 ] = - var_0 [ 0 ] ;
    var_2 [ 0 ] [ 1 ] = 0 ;
    for ( int var_3 = 1 ;
    var_3 < var_1 ;
    var_3 ++ ) {
      var_2 [ var_3 ] [ 1 ] = Math . max ( var_2 [ var_3 - 1 ] [ 1 ] , var_2 [ var_3 - 1 ] [ 0 ] + var_0 [ var_3 ] ) ;
      var_2 [ var_3 ] [ 0 ] = var_2 [ var_3 - 1 ] [ 0 ] ;
      if ( var_3 >= 2 ) {
        var_2 [ var_3 ] [ 0 ] = Math . max ( var_2 [ var_3 ] [ 0 ] , var_2 [ var_3 - 2 ] [ 1 ] - var_0 [ var_3 ] ) ;
      }
      else {
        var_2 [ var_3 ] [ 0 ] = Math . max ( var_2 [ var_3 ] [ 0 ] , - var_0 [ var_3 ] ) ;
      }
    }
    return var_2 [ var_1 - 1 ] [ 1 ] ;
  }
  