摘要: class Solution { public: ListNode* mergeKLists(vector& lists) { ListNode* head = NULL; ListNode* current = NULL; for (int i = 0; i val; int min_index = 0; ... 阅读全文
posted @ 2017-11-27 21:24 nosaferyao 阅读(110) 评论(0) 推荐(0) 编辑
摘要: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: ListNode* m... 阅读全文
posted @ 2017-11-27 21:12 nosaferyao 阅读(168) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: vector> threeSum(vector& nums) { sort(nums.begin(), nums.end()); vector > validSet; for (int i = 0; i = 1 && nums[i] == nums[i-1])continu... 阅读全文
posted @ 2017-11-27 20:57 nosaferyao 阅读(152) 评论(0) 推荐(0) 编辑