摘要: class Solution {public: int maxProfit(vector<int> &prices) { if(prices.size() == 0) return 0; int min=prices[0],max=0,sum=prices.size(); for(int i=0;i 阅读全文
posted @ 2017-03-08 18:36 李富香 阅读(105) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: /** * @param n: An integer * @return: An integer */ int climbStairs(int n) { // write your code here if(n==0) return 1; int su 阅读全文
posted @ 2017-03-08 18:31 李富香 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 删除排序数组中的重复数字 class Solution {public: /** * @param A: a list of integers * @return : return an integer */ int removeDuplicates(vector<int> &nums) { // 阅读全文
posted @ 2017-03-08 18:30 李富香 阅读(84) 评论(0) 推荐(0) 编辑