随笔分类 - LeetCode题解
摘要:1 //双指针算法模板+哈希表 2 class Solution 3 { 4 public: 5 int lengthOfLongestSubstring(string s) 6 { 7 unordered_map<char,int> nums; 8 int res = 0; 9 for(int i
阅读全文
摘要:1 class Solution 2 { 3 public: 4 ListNode* addTwoNumbers(ListNode* l1, ListNode* l2) 5 { 6 ListNode* dummy = new ListNode(-1); 7 ListNode* pre = dummy
阅读全文
摘要:https://leetcode-cn.com/problems/two-sum/ 1 //哈希表 2 class Solution 3 { 4 public: 5 vector<int> twoSum(vector<int>& nums, int target) 6 { 7 unordered_m
阅读全文

浙公网安备 33010602011771号