摘要: 今天发现leetcode比别的都好。。。因为面试面到121题,我愚笨的脑袋用了两个for循环,只用一个for循环我是想不出的。 121:class Solution {public: int maxProfit(vector& prices) { size_t ... 阅读全文
posted @ 2017-02-22 19:20 StevenLuke 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 一开始我用两个循环,如果只用一个循环的话:int maxProfit(vector& prices) { size_t size = prices.size(); if (size <= 1) return 0; int min = INT... 阅读全文
posted @ 2017-02-22 18:28 StevenLuke 阅读(230) 评论(0) 推荐(0) 编辑