leetcode 121
dp? my answer
class Solution {
public:int maxProfit(vector<int>& prices) {int bd=prices[0],sd=0;int max_num=0;for(int i=1;i!=prices.size();++i){sd=prices[i];if(sd<bd) bd=sd;else if(sd-bd>max_num)max_num=sd-bd;}return max_num;}
};
END