comefrom: <awangdev>122. Best Time to Buy and Sell Stock II_2.java
code: public int maxProfit(int[] prices) {
          if (prices == null || prices.length <= 1) {
              return 0;
          }
          int curr = 0;
          int profit = 0;
          int peek = 1;
          while(curr < prices.length) {
              while (peek < prices.length && prices[peek - 1] <= prices[peek]) {
                  peek++;
              }
              profit += prices[peek - 1] - prices[curr];
              curr = peek;
              peek = curr + 1;
          }
          return profit;
      }
masked: public int sample_funcname ( int [ ] var_0 ) {
    if ( var_0 == null || var_0 . length <= 1 ) {
      return 0 ;
    }
    int var_1 = 0 ;
    int var_2 = 0 ;
    int var_3 = 1 ;
    while ( var_1 < var_0 . length ) {
      while ( var_3 < var_0 . length && var_0 [ var_3 - 1 ] <= var_0 [ var_3 ] ) {
        var_3 ++ ;
      }
      var_2 += var_0 [ var_3 - 1 ] - var_0 [ var_1 ] ;
      var_1 = var_3 ;
      var_3 = var_1 + 1 ;
    }
    return var_2 ;
  }
  