class Solution {
public int maxProfit(int[] prices) {
int left = 0, right = 0;
int max = 0;
for(int i = 0;i<prices.length ; i++){
for(int j = i+1; j < prices.length; j++){
if(prices[j]- prices[i]>max){
max = prices[j] - prices[i];
left = i;
right = j;
}
}
}
return max;
}
}
hh, 果不其然