- K 个一组翻转链表 4
121.买卖股票 4
动态规划
class Solution {
public int maxProfit(int[] prices) {
int min = prices[0];
int maxProfit = 0;
for(int i = 1 ; i < prices.length ;i++){
maxProfit = Math.max(maxProfit,prices[i]-min);
min = Math.min(min,