<awangdev>122. Best Time to Buy and Sell Stock II_1.java
public int maxProfit(int[] prices) {
        if (prices == null || prices.length == 0) {
            return 0;
        }
        int profit = 0;
        for (int i = 1; i < prices.length; i++) {
            if (prices[i] > prices[i - 1]) {
                profit += prices[i] - prices[i - 1];
            }
        }
        return profit;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 ) {
    return 0 ;
  }
  int var_4 = 0 ;
  for ( int var_6 = 1 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    if ( var_0 [ var_6 ] > var_0 [ var_6 - 1 ] ) {
      var_4 += var_0 [ var_6 ] - var_0 [ var_6 - 1 ] ;
    }
  }
  return var_4 ;
}
