哈希集合
文章平均质量分 80
memcpy0
希望探索文理结合的自由之路。
展开
-
LeetCode 2465. Number of Distinct Averages【哈希表,双指针,排序】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-06-05 13:35:54 · 522 阅读 · 0 评论 -
LeetCode 2441. Largest Positive Integer That Exists With Its Negative【哈希集合】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-05-13 18:16:29 · 780 阅读 · 0 评论 -
LeetCode 1016. Binary String With Substrings Representing 1 To N【枚举,哈希集合,数学,字符串】中等
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-05-13 17:48:53 · 57 阅读 · 0 评论 -
LeetCode 970. Powerful Integers【哈希表,枚举】中等
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-05-02 15:13:01 · 627 阅读 · 0 评论 -
LeetCode 2357. Make Array Zero by Subtracting Equal Amounts【贪心,模拟,桶排,哈希集合】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。为了方便在PC上运行调试、分享代码文件,我还建立了相关的。原创 2023-04-03 19:17:22 · 256 阅读 · 0 评论 -
LeetCode 2367. Number of Arithmetic Triplets【哈希表,三指针】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。为了方便在PC上运行调试、分享代码文件,我还建立了相关的。原创 2023-04-01 02:06:15 · 353 阅读 · 0 评论 -
LeetCode 2395. Find Subarrays With Equal Sum【哈希表,数组】简单
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。。原创 2023-03-28 23:52:14 · 146 阅读 · 0 评论 -
LeetCode 1487. Making File Names Unique【字符串,哈希表】中等
本文属于「征服LeetCode」系列文章之一,这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁,本系列将至少持续到刷完所有无锁题之日为止;由于LeetCode还在不断地创建新题,本系列的终止日期可能是永远。在这一系列刷题文章中,我不仅会讲解多种解题思路及其优化,还会用多种编程语言实现题解,涉及到通用解法时更将归纳总结出相应的算法模板。为了方便在PC上运行调试、分享代码文件,我还建立了相关的。原创 2023-03-03 15:33:16 · 576 阅读 · 0 评论 -
LeetCode C++ 939. Minimum Area Rectangle【Hash Table】中等
Given a set of points in the xy-plane, determine the minimum area of a rectangle formed from these points, with sides parallel to the x and y axes.If there isn't any rectangle, return 0.Example 1:Input: [[1,1],[1,3],[3,1],[3,3],[2,2]]Output: 4Example原创 2021-05-15 23:07:03 · 158 阅读 · 0 评论 -
LeetCode C++ 面试题 16.21. Sum Swap LCCI【Hash Table/Sort】中等
Given two arrays of integers, find a pair of values (one value from each array) that you can swap to give the two arrays the same sum.Return an array, where the first element is the element in the first array that will be swapped, and the second element i原创 2021-04-21 22:31:00 · 143 阅读 · 0 评论 -
LeetCode C++ 1261. Find Elements in a Contaminated Binary Tree【Tree/Hash Table】中等
Given a binary tree with the following rules: root.val == 0 If treeNode.val == x and treeNode.left != null, then treeNode.left.val == 2 * x + 1 If treeNode.val == x and treeNode.right != null, then treeNode.right.val == 2 * x + 2Now the binary t原创 2021-01-18 22:59:53 · 169 阅读 · 0 评论