From 7eeb1778c78a1aadf23af124c702f1f2ac068ae4 Mon Sep 17 00:00:00 2001 From: wonder Date: Wed, 13 May 2026 10:36:27 +0800 Subject: [PATCH] vault backup: 2026-05-13 10:36:27 --- README.md | 254 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 252 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9213cb4..29c36bb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,253 @@ -# leetcode-go +# LeetCode Go 🚀 -🔥 LeetCode Hot 100 | Golang \ No newline at end of file +> Go 语言刷题库 · 按知识点分类系统训练 + +## 题单概览 + +| 难度 | 题数 | +|:----:|:----:| +| 🟢 简单 | 12 | +| 🟡 中等 | 73 | +| 🔴 困难 | 12 | +| **合计** | **97** | + +--- + +## 目录 + +- [[哈希/]] +- [[双指针/]] +- [[滑动窗口/]] +- [[子串/]] +- [[普通数组/]] +- [[矩阵/]] +- [[链表/]] +- [[二叉树/]] +- [[图论/]] +- [[回溯/]] +- [[二分查找/]] +- [[栈/]] +- [[堆/]] +- [[贪心算法/]] +- [[动态规划/]] +- [[多维动态规划/]] +- [[技巧/]] + +--- + +### [[哈希/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 01 | [两数之和](https://leetcode.cn/problems/two-sum/) | 🟢 简单 | [[哈希/01-两数之和]] | +| 02 | [字母异位词分组](https://leetcode.cn/problems/group-anagrams/) | 🟡 中等 | [[哈希/02-字母异位词分组]] | +| 03 | [最长连续序列](https://leetcode.cn/problems/longest-consecutive-sequence/) | 🟡 中等 | [[哈希/03-最长连续序列]] | + +--- + +### [[双指针/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 04 | [移动零](https://leetcode.cn/problems/move-zeroes/) | 🟢 简单 | [[双指针/04-移动零]] | +| 05 | [盛最多水的容器](https://leetcode.cn/problems/container-with-most-water/) | 🟡 中等 | [[双指针/05-盛最多水的容器]] | +| 06 | [三数之和](https://leetcode.cn/problems/3sum/) | 🟡 中等 | [[双指针/06-三数之和]] | +| 07 | [接雨水](https://leetcode.cn/problems/trapping-rain-water/) | 🔴 困难 | [[双指针/07-接雨水]] | + +--- + +### [[滑动窗口/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 08 | [无重复字符的最长子串](https://leetcode.cn/problems/longest-substring-without-repeating-characters/) | 🟡 中等 | [[滑动窗口/08-无重复字符的最长子串]] | +| 09 | [找到字符串中所有字母异位词](https://leetcode.cn/problems/find-all-anagrams-in-a-string/) | 🟡 中等 | [[滑动窗口/09-找到字符串中所有字母异位词]] | + +--- + +### [[子串/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 10 | [和为 K 的子数组](https://leetcode.cn/problems/subarray-sum-equals-k/) | 🟡 中等 | [[子串/10-和为 K 的子数组]] | +| 11 | [滑动窗口最大值](https://leetcode.cn/problems/sliding-window-maximum/) | 🔴 困难 | [[子串/11-滑动窗口最大值]] | +| 12 | [最小覆盖子串](https://leetcode.cn/problems/minimum-window-substring/) | 🔴 困难 | [[子串/12-最小覆盖子串]] | + +--- + +### [[普通数组/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 13 | [最大子数组和](https://leetcode.cn/problems/maximum-subarray/) | 🟡 中等 | [[普通数组/13-最大子数组和]] | +| 14 | [合并区间](https://leetcode.cn/problems/merge-intervals/) | 🟡 中等 | [[普通数组/14-合并区间]] | +| 15 | [轮转数组](https://leetcode.cn/problems/rotate-array/) | 🟡 中等 | [[普通数组/15-轮转数组]] | +| 16 | [除了自身以外数组的乘积](https://leetcode.cn/problems/product-of-array-except-self/) | 🟡 中等 | [[普通数组/16-除了自身以外数组的乘积]] | +| 17 | [缺失的第一个正数](https://leetcode.cn/problems/first-missing-positive/) | 🔴 困难 | [[普通数组/17-缺失的第一个正数]] | + +--- + +### [[矩阵/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 18 | [矩阵置零](https://leetcode.cn/problems/set-matrix-zeroes/) | 🟡 中等 | [[矩阵/18-矩阵置零]] | +| 19 | [螺旋矩阵](https://leetcode.cn/problems/spiral-matrix/) | 🟡 中等 | [[矩阵/19-螺旋矩阵]] | +| 20 | [旋转图像](https://leetcode.cn/problems/rotate-image/) | 🟡 中等 | [[矩阵/20-旋转图像]] | +| 21 | [搜索二维矩阵 II](https://leetcode.cn/problems/search-a-2d-matrix-ii/) | 🟡 中等 | [[矩阵/21-搜索二维矩阵 II]] | + +--- + +### [[链表/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 22 | [相交链表](https://leetcode.cn/problems/intersection-of-two-linked-lists/) | 🟢 简单 | [[链表/22-相交链表]] | +| 23 | [反转链表](https://leetcode.cn/problems/reverse-linked-list/) | 🟢 简单 | [[链表/23-反转链表]] | +| 24 | [回文链表](https://leetcode.cn/problems/palindrome-linked-list/) | 🟢 简单 | [[链表/24-回文链表]] | +| 25 | [环形链表](https://leetcode.cn/problems/linked-list-cycle/) | 🟢 简单 | [[链表/25-环形链表]] | +| 26 | [环形链表 II](https://leetcode.cn/problems/linked-list-cycle-ii/) | 🟡 中等 | [[链表/26-环形链表 II]] | +| 27 | [合并两个有序链表](https://leetcode.cn/problems/merge-two-sorted-lists/) | 🟢 简单 | [[链表/27-合并两个有序链表]] | +| 28 | [两数相加](https://leetcode.cn/problems/add-two-numbers/) | 🟡 中等 | [[链表/28-两数相加]] | +| 29 | [删除链表的倒数第 N 个结点](https://leetcode.cn/problems/remove-nth-node-from-end-of-list/) | 🟡 中等 | [[链表/29-删除链表的倒数第 N 个结点]] | +| 30 | [两两交换链表中的节点](https://leetcode.cn/problems/swap-nodes-in-pairs/) | 🟡 中等 | [[链表/30-两两交换链表中的节点]] | +| 31 | [K 个一组翻转链表](https://leetcode.cn/problems/reverse-nodes-in-k-group/) | 🔴 困难 | [[链表/31-K 个一组翻转链表]] | +| 32 | [随机链表的复制](https://leetcode.cn/problems/copy-list-with-random-pointer/) | 🟡 中等 | [[链表/32-随机链表的复制]] | +| 33 | [排序链表](https://leetcode.cn/problems/sort-list/) | 🟡 中等 | [[链表/33-排序链表]] | +| 34 | [合并 K 个升序链表](https://leetcode.cn/problems/merge-k-sorted-lists/) | 🔴 困难 | [[链表/34-合并 K 个升序链表]] | +| 35 | [LRU 缓存](https://leetcode.cn/problems/lru-cache/) | 🟡 中等 | [[链表/35-LRU 缓存]] | + +--- + +### [[二叉树/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 36 | [二叉树的中序遍历](https://leetcode.cn/problems/binary-tree-inorder-traversal/) | 🟢 简单 | [[二叉树/36-二叉树的中序遍历]] | +| 37 | [二叉树的最大深度](https://leetcode.cn/problems/maximum-depth-of-binary-tree/) | 🟢 简单 | [[二叉树/37-二叉树的最大深度]] | +| 38 | [翻转二叉树](https://leetcode.cn/problems/invert-binary-tree/) | 🟢 简单 | [[二叉树/38-翻转二叉树]] | +| 39 | [对称二叉树](https://leetcode.cn/problems/symmetric-tree/) | 🟢 简单 | [[二叉树/39-对称二叉树]] | +| 40 | [二叉树的直径](https://leetcode.cn/problems/diameter-of-binary-tree/) | 🟢 简单 | [[二叉树/40-二叉树的直径]] | +| 41 | [二叉树的层序遍历](https://leetcode.cn/problems/binary-tree-level-order-traversal/) | 🟡 中等 | [[二叉树/41-二叉树的层序遍历]] | +| 42 | [将有序数组转换为二叉搜索树](https://leetcode.cn/problems/convert-sorted-array-to-binary-search-tree/) | 🟢 简单 | [[二叉树/42-将有序数组转换为二叉搜索树]] | +| 43 | [验证二叉搜索树](https://leetcode.cn/problems/validate-binary-search-tree/) | 🟡 中等 | [[二叉树/43-验证二叉搜索树]] | +| 44 | [二叉搜索树中第 K 小的元素](https://leetcode.cn/problems/kth-smallest-element-in-a-bst/) | 🟡 中等 | [[二叉树/44-二叉搜索树中第 K 小的元素]] | +| 45 | [二叉树的右视图](https://leetcode.cn/problems/binary-tree-right-side-view/) | 🟡 中等 | [[二叉树/45-二叉树的右视图]] | +| 46 | [二叉树展开为链表](https://leetcode.cn/problems/flatten-binary-tree-to-linked-list/) | 🟡 中等 | [[二叉树/46-二叉树展开为链表]] | +| 47 | [从前序与中序遍历序列构造二叉树](https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/) | 🟡 中等 | [[二叉树/47-从前序与中序遍历序列构造二叉树]] | +| 48 | [路径总和 III](https://leetcode.cn/problems/path-sum-iii/) | 🟡 中等 | [[二叉树/48-路径总和 III]] | +| 49 | [二叉树的最近公共祖先](https://leetcode.cn/problems/lowest-common-ancestor-of-a-binary-tree/) | 🟡 中等 | [[二叉树/49-二叉树的最近公共祖先]] | +| 50 | [二叉树中的最大路径和](https://leetcode.cn/problems/binary-tree-maximum-path-sum/) | 🔴 困难 | [[二叉树/50-二叉树中的最大路径和]] | + +--- + +### [[图论/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 51 | [岛屿数量](https://leetcode.cn/problems/number-of-islands/) | 🟡 中等 | [[图论/51-岛屿数量]] | +| 52 | [腐烂的橘子](https://leetcode.cn/problems/rotting-oranges/) | 🟡 中等 | [[图论/52-腐烂的橘子]] | +| 53 | [课程表](https://leetcode.cn/problems/course-schedule/) | 🟡 中等 | [[图论/53-课程表]] | +| 54 | [实现 Trie (前缀树)](https://leetcode.cn/problems/implement-trie-prefix-tree/) | 🟡 中等 | [[图论/54-实现 Trie (前缀树)]] | + +--- + +### [[回溯/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 55 | [全排列](https://leetcode.cn/problems/permutations/) | 🟡 中等 | [[回溯/55-全排列]] | +| 56 | [子集](https://leetcode.cn/problems/subsets/) | 🟡 中等 | [[回溯/56-子集]] | +| 57 | [电话号码的字母组合](https://leetcode.cn/problems/letter-combinations-of-a-phone-number/) | 🟡 中等 | [[回溯/57-电话号码的字母组合]] | +| 58 | [组合总和](https://leetcode.cn/problems/combination-sum/) | 🟡 中等 | [[回溯/58-组合总和]] | +| 59 | [括号生成](https://leetcode.cn/problems/generate-parentheses/) | 🟡 中等 | [[回溯/59-括号生成]] | +| 60 | [单词搜索](https://leetcode.cn/problems/word-search/) | 🟡 中等 | [[回溯/60-单词搜索]] | +| 61 | [分割回文串](https://leetcode.cn/problems/palindrome-partitioning/) | 🟡 中等 | [[回溯/61-分割回文串]] | +| 62 | [N 皇后](https://leetcode.cn/problems/n-queens/) | 🔴 困难 | [[回溯/62-N 皇后]] | + +--- + +### [[二分查找/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 63 | [搜索插入位置](https://leetcode.cn/problems/search-insert-position/) | 🟢 简单 | [[二分查找/63-搜索插入位置]] | +| 64 | [搜索二维矩阵](https://leetcode.cn/problems/search-a-2d-matrix/) | 🟡 中等 | [[二分查找/64-搜索二维矩阵]] | +| 65 | [在排序数组中查找元素的第一个和最后一个位置](https://leetcode.cn/problems/find-first-and-last-position-of-element-in-sorted-array/) | 🟡 中等 | [[二分查找/65-在排序数组中查找元素的第一个和最后一个位置]] | +| 66 | [搜索旋转排序数组](https://leetcode.cn/problems/search-in-rotated-sorted-array/) | 🟡 中等 | [[二分查找/66-搜索旋转排序数组]] | +| 67 | [寻找旋转排序数组中的最小值](https://leetcode.cn/problems/find-minimum-in-rotated-sorted-array/) | 🟡 中等 | [[二分查找/67-寻找旋转排序数组中的最小值]] | +| 68 | [寻找两个正序数组的中位数](https://leetcode.cn/problems/median-of-two-sorted-arrays/) | 🔴 困难 | [[二分查找/68-寻找两个正序数组的中位数]] | + +--- + +### [[栈/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 69 | [有效的括号](https://leetcode.cn/problems/valid-parentheses/) | 🟢 简单 | [[栈/69-有效的括号]] | +| 70 | [最小栈](https://leetcode.cn/problems/min-stack/) | 🟡 中等 | [[栈/70-最小栈]] | +| 71 | [字符串解码](https://leetcode.cn/problems/decode-string/) | 🟡 中等 | [[栈/71-字符串解码]] | +| 72 | [每日温度](https://leetcode.cn/problems/daily-temperatures/) | 🟡 中等 | [[栈/72-每日温度]] | +| 73 | [柱状图中最大的矩形](https://leetcode.cn/problems/largest-rectangle-in-histogram/) | 🔴 困难 | [[栈/73-柱状图中最大的矩形]] | + +--- + +### [[堆/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 74 | [数组中的第 K 个最大元素](https://leetcode.cn/problems/kth-largest-element-in-an-array/) | 🟡 中等 | [[堆/74-数组中的第 K 个最大元素]] | +| 75 | [前 K 个高频元素](https://leetcode.cn/problems/top-k-frequent-elements/) | 🟡 中等 | [[堆/75-前 K 个高频元素]] | +| 76 | [数据流的中位数](https://leetcode.cn/problems/find-median-from-data-stream/) | 🔴 困难 | [[堆/76-数据流的中位数]] | + +--- + +### [[贪心算法/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 77 | [买卖股票的最佳时机](https://leetcode.cn/problems/best-time-to-buy-and-sell-stock/) | 🟢 简单 | [[贪心算法/77-买卖股票的最佳时机]] | +| 78 | [跳跃游戏](https://leetcode.cn/problems/jump-game/) | 🟡 中等 | [[贪心算法/78-跳跃游戏]] | +| 79 | [跳跃游戏 II](https://leetcode.cn/problems/jump-game-ii/) | 🟡 中等 | [[贪心算法/79-跳跃游戏 II]] | +| 80 | [划分字母区间](https://leetcode.cn/problems/partition-labels/) | 🟡 中等 | [[贪心算法/80-划分字母区间]] | + +--- + +### [[动态规划/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 81 | [爬楼梯](https://leetcode.cn/problems/climbing-stairs/) | 🟢 简单 | [[动态规划/81-爬楼梯]] | +| 82 | [杨辉三角](https://leetcode.cn/problems/pascals-triangle/) | 🟢 简单 | [[动态规划/82-杨辉三角]] | +| 83 | [打家劫舍](https://leetcode.cn/problems/house-robber/) | 🟡 中等 | [[动态规划/83-打家劫舍]] | +| 84 | [完全平方数](https://leetcode.cn/problems/perfect-squares/) | 🟡 中等 | [[动态规划/84-完全平方数]] | +| 85 | [零钱兑换](https://leetcode.cn/problems/coin-change/) | 🟡 中等 | [[动态规划/85-零钱兑换]] | +| 86 | [单词拆分](https://leetcode.cn/problems/word-break/) | 🟡 中等 | [[动态规划/86-单词拆分]] | +| 87 | [最长递增子序列](https://leetcode.cn/problems/longest-increasing-subsequence/) | 🟡 中等 | [[动态规划/87-最长递增子序列]] | +| 88 | [乘积最大子数组](https://leetcode.cn/problems/maximum-product-subarray/) | 🟡 中等 | [[动态规划/88-乘积最大子数组]] | +| 89 | [分割等和子集](https://leetcode.cn/problems/partition-equal-subset-sum/) | 🟡 中等 | [[动态规划/89-分割等和子集]] | +| 90 | [最长有效括号](https://leetcode.cn/problems/longest-valid-parentheses/) | 🔴 困难 | [[动态规划/90-最长有效括号]] | + +--- + +### [[多维动态规划/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 91 | [不同路径](https://leetcode.cn/problems/unique-paths/) | 🟡 中等 | [[多维动态规划/91-不同路径]] | +| 92 | [最小路径和](https://leetcode.cn/problems/minimum-path-sum/) | 🟡 中等 | [[多维动态规划/92-最小路径和]] | +| 93 | [最长回文子串](https://leetcode.cn/problems/longest-palindromic-substring/) | 🟡 中等 | [[多维动态规划/93-最长回文子串]] | +| 94 | [最长公共子序列](https://leetcode.cn/problems/longest-common-subsequence/) | 🟡 中等 | [[多维动态规划/94-最长公共子序列]] | +| 95 | [编辑距离](https://leetcode.cn/problems/edit-distance/) | 🟡 中等 | [[多维动态规划/95-编辑距离]] | + +--- + +### [[技巧/]] + +| # | 题目 | 难度 | 解答 | +|---|------|:----:|------| +| 96 | [只出现一次的数字](https://leetcode.cn/problems/single-number/) | 🟢 简单 | [[技巧/96-只出现一次的数字]] | +| 97 | [多数元素](https://leetcode.cn/problems/majority-element/) | 🟢 简单 | [[技巧/97-多数元素]] | +| 98 | [颜色分类](https://leetcode.cn/problems/sort-colors/) | 🟡 中等 | [[技巧/98-颜色分类]] | +| 99 | [下一个排列](https://leetcode.cn/problems/next-permutation/) | 🟡 中等 | [[技巧/99-下一个排列]] | +| 100 | [寻找重复数](https://leetcode.cn/problems/find-the-duplicate-number/) | 🟡 中等 | [[技巧/100-寻找重复数]] |