摘要: 讲真的,这个我只会用递归去做,但是lintcode上面超时,所以只有在网上找了个动态规划的,虽然这个程序懂了,但是我觉得还是挺不容易的真正弄懂的话…… class Solution {public: /** * @param n: An integer * @return: An integer * 阅读全文
posted @ 2017-03-07 22:39 muzi_ln 阅读(192) 评论(0) 推荐(0)
摘要: class Solution {public: /** * @param prices: Given an integer array * @return: Maximum profit */ int maxProfit(vector<int> &prices) { // write your co 阅读全文
posted @ 2017-03-07 22:37 muzi_ln 阅读(243) 评论(0) 推荐(0)
摘要: 时间自由度为o(n),空间自由度为o(1); class Solution {public: /** * @param A: a list of integers * @return : return an integer */ int removeDuplicates(vector<int> &n 阅读全文
posted @ 2017-03-07 22:34 muzi_ln 阅读(311) 评论(0) 推荐(0)