class Solution {
public:
    /**
     * 
     * @param prices int整型vector 
     * @return int整型
     */
    int maxProfit(vector<int>& prices) {
        // write code here
        if(prices.size() <= 1)
            return 0;
        int mProfit = 0;
        for(int i = 1; i < prices.size(); i++){
            for(int j = 0; j < i; j++){
                mProfit = max(mProfit, prices[i]-prices[j]);
            }
        }
        return mProfit;
    }
};