摘要: //Time: O(n),Space:O(1) //定义2个游标,也称快慢指针法 class Solution { public: int removeDuplicates(vector<int>& nums) { int p=1; if(nums.size()==0) return 0; for( 阅读全文
posted @ 2020-01-05 16:54 repinkply 阅读(2) 评论(0) 推荐(0)
摘要: //Time:O(n),Space:O(n) //语言:C++11 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> res={-1,-1}; unordered_map< 阅读全文
posted @ 2020-01-05 12:46 repinkply 阅读(5) 评论(0) 推荐(0)