07 2022 档案

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

Language: HTML
点击右上角即可分享
微信分享提示