📅  最后修改于: 2022-03-11 14:52:32.539000             🧑  作者: Mango
class Solution {
public int maxProfit(int[] prices) {
int minimum=Integer.MAX_VALUE;
int maxprofit=0;
for(int i=0;imaxprofit) maxprofit=prices[i]-minimum;
}
return maxprofit;
}
}