买卖股票的最佳时机
int ret = 0;
if(prices.size()<2)
return ret;
int lowest = prices[0];
for(int i=1;i<prices.size();i++)
{
int cur = prices[i];
ret = max(ret,cur-lowest);
lowest = min(lowest,cur);
}
return ret;
}
};