07 2022 档案
摘要:周赛传送门 4500. 三个元素 本题可以学习的地方: 1.用map来存值和下标,map会自动排序 2.输出map中的元素可以先用vector存起来,然后输出vector中的元素 #include <iostream> #include <map> #include <vector> using n
阅读全文
摘要:题单:LeetCode链表 2. 两数相加 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode() : val(0), next(nullptr) {
阅读全文
摘要:记录LeetCode 热题 HOT 100 代码 1. 两数之和 class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> hash; for(int i
阅读全文