leetcode推前LeetCode题目记录目录二和class Solution { public: vector twoSum (vector& nums, int target) { map m; int l = nums.size(); vector ret; for (int i = 0; i < l; i++) { if (m.count(nums[i])) { ret.push_back(m[nums[i]]); ret.push_back(i); return ret; } else { m[target - nums[i]] = i; } } return ret; } }; 添加两个数字 / Definition for singly-linked list. struct ListNode { int val; ListNode next; ListNode(int x) : val(x), next(NULL) {} }; */ class Solu