![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode cpp
Mason97
这个作者很懒,什么都没留下…
展开
-
206. 反转链表【cpp】
class Solution{public: ListNode *reverseList(ListNode *head) { ListNode *myHead = nullptr; while (head != nullptr) { ListNode *tmp = head->next; head->next = myHead; myHead = head.原创 2020-08-06 17:35:55 · 189 阅读 · 0 评论 -
1. 两数之和【cpp】
第一版:class Solution{public: vector<int> twoSum(vector<int> &nums, int target) { vector<int> res; map<int, int> myMap; for (int i = 0; i < nums.size(); i++) { if (myMap.fi原创 2020-08-06 17:07:14 · 224 阅读 · 0 评论