标签:load bsp nbsp 技术 tps src width i++ pre
class Solution { public: int maxProfit(vector<int>& prices) { if(prices.size()<=1) return 0; int ans=prices[0]; int ans1=0; for(int i=1;i<prices.size();i++) { ans=min(ans,prices[i]); ans1=max(ans1,prices[i]-ans); } return ans1; } };
标签:load bsp nbsp 技术 tps src width i++ pre
原文地址:https://www.cnblogs.com/Vampire6/p/13121938.html