Skip to content

Commit 3081212

Browse files
author
lucifer
committed
feat: 将合集移到外面
1 parent a7e21cc commit 3081212

File tree

2 files changed

+251
-1
lines changed

2 files changed

+251
-1
lines changed

README.md

Lines changed: 250 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,259 @@ leetcode 题解,记录自己的 leetcode 解题之路。
128128
129129
目前更新了 200 多道题解,加上专题涉及的题目,差不多有 **300 道**
130130

131-
- [高频考题合集(简单难度)](./collections/easy.md)
131+
#### 简单难度题目合集
132+
133+
这里的题目难度比较小, 大多是模拟题,或者是很容易看出解法的题目,另外简单题目一般使用暴力法都是可以解决的。 这个时候只有看一下数据范围,思考下你的算法复杂度就行了。
134+
135+
当然也不排除很多 hard 题目也可以暴力模拟,大家平时多注意数据范围即可。
136+
137+
以下是我列举的经典题目(带 91 字样的表示出自 **91 天学算法**活动):
138+
139+
- [面试题 17.12. BiNode](./problems/binode-lcci.md)
140+
- [0001. 两数之和](./problems/1.two-sum.md)
141+
- [0020. 有效的括号](./problems/20.valid-parentheses.md)
142+
- [0021. 合并两个有序链表](./problems/21.merge-two-sorted-lists.md)
143+
- [0026. 删除排序数组中的重复项](./problems/26.remove-duplicates-from-sorted-array.md)
144+
- [0053. 最大子序和](./problems/53.maximum-sum-subarray-cn.md)
145+
- [0066. 加一](./problems/66.plus-one.md) 91
146+
- [0088. 合并两个有序数组](./problems/88.merge-sorted-array.md)
147+
- [0101. 对称二叉树](./problems/101.symmetric-tree.md)
148+
- [0104. 二叉树的最大深度](./problems/104.maximum-depth-of-binary-tree.md)
149+
- [0108. 将有序数组转换为二叉搜索树](./problems/108.convert-sorted-array-to-binary-search-tree.md)
150+
- [0121. 买卖股票的最佳时机](./problems/121.best-time-to-buy-and-sell-stock.md)
151+
- [0122. 买卖股票的最佳时机 II](./problems/122.best-time-to-buy-and-sell-stock-ii.md)
152+
- [0125. 验证回文串](./problems/125.valid-palindrome.md)
153+
- [0136. 只出现一次的数字](./problems/136.single-number.md)
154+
- [0155. 最小栈](./problems/155.min-stack.md)
155+
- [0160. 相交链表](./problems/160.Intersection-of-Two-Linked-Lists.md) 91
156+
- [0167. 两数之和 II 输入有序数组](./problems/167.two-sum-ii-input-array-is-sorted.md)
157+
- [0169. 多数元素](./problems/169.majority-element.md)
158+
- [0172. 阶乘后的零](./problems/172.factorial-trailing-zeroes.md)
159+
- [0190. 颠倒二进制位](./problems/190.reverse-bits.md)
160+
- [0191. 位 1 的个数](./problems/191.number-of-1-bits.md)
161+
- [0198. 打家劫舍](./problems/198.house-robber.md)
162+
- [0203. 移除链表元素](./problems/203.remove-linked-list-elements.md)
163+
- [0206. 反转链表](./problems/206.reverse-linked-list.md)
164+
- [0219. 存在重复元素 II](./problems/219.contains-duplicate-ii.md)
165+
- [0226. 翻转二叉树](./problems/226.invert-binary-tree.md)
166+
- [0232. 用栈实现队列](./problems/232.implement-queue-using-stacks.md) 91
167+
- [0263. 丑数](./problems/263.ugly-number.md)
168+
- [0283. 移动零](./problems/283.move-zeroes.md)
169+
- [0342. 4 的幂](./problems/342.power-of-four.md)
170+
- [0349. 两个数组的交集](./problems/349.intersection-of-two-arrays.md)
171+
- [0371. 两整数之和](./problems/371.sum-of-two-integers.md)
172+
- [401. 二进制手表](./problems/401.binary-watch.md)
173+
- [0437. 路径总和 III](./problems/437.path-sum-iii.md)
174+
- [0455. 分发饼干](./problems/455.AssignCookies.md)
175+
- [0575. 分糖果](./problems/575.distribute-candies.md)
176+
- [821. 字符的最短距离](./problems/821.shortest-distance-to-a-character.md) 91
177+
- [0874. 模拟行走机器人](./problems/874.walking-robot-simulation.md)
178+
- [1260. 二维网格迁移](./problems/1260.shift-2d-grid.md)
179+
- [1332. 删除回文子序列](./problems/1332.remove-palindromic-subsequences.md)
180+
132181
- [高频考题合集(中等难度)](./collections/medium.md)
133182
- [高频考题合集(困难难度)](./collections/hard.md)
134183

184+
#### 中等难度题目合集
185+
186+
中等题目是力扣比例最大的部分,因此这部分我的题解也是最多的。 大家不要太过追求难题,先把中等难度题目做熟了再说。
187+
188+
这部分的题目要不需要我们挖掘题目的内含信息, 将其抽象成简单题目。 要么是一些写起来比较麻烦的题目, 一些人编码能力不行就挂了。因此大家一定要自己做, 即使看了题解”会了“,也要自己码一遍。自己不亲自写一遍,里面的细节永远不知道。
189+
190+
以下是我列举的经典题目(带 91 字样的表示出自 **91 天学算法**活动):
191+
192+
- [面试题 17.09. 第 k 个数](./problems/get-kth-magic-number-lcci.md)
193+
- [面试题 17.23. 最大黑方阵](./problems/max-black-square-lcci.md)🆕
194+
195+
- [0002. 两数相加](./problems/2.add-two-numbers.md)
196+
- [0003. 无重复字符的最长子串](./problems/3.longest-substring-without-repeating-characters.md)
197+
- [0005. 最长回文子串](./problems/5.longest-palindromic-substring.md)
198+
- [0011. 盛最多水的容器](./problems/11.container-with-most-water.md)
199+
- [0015. 三数之和](./problems/15.3sum.md)
200+
- [0017. 电话号码的字母组合](./problems/17.Letter-Combinations-of-a-Phone-Number.md)
201+
- [0019. 删除链表的倒数第 N 个节点](./problems/19.removeNthNodeFromEndofList.md)
202+
- [0022. 括号生成](./problems/22.generate-parentheses.md)
203+
- [0024. 两两交换链表中的节点](./problems/24.swapNodesInPairs.md)
204+
- [0029. 两数相除](./problems/29.divide-two-integers.md)
205+
- [0031. 下一个排列](./problems/31.next-permutation.md)
206+
- [0033. 搜索旋转排序数组](./problems/33.search-in-rotated-sorted-array.md)
207+
- [0039. 组合总和](./problems/39.combination-sum.md)
208+
- [0040. 组合总和 II](./problems/40.combination-sum-ii.md)
209+
- [0046. 全排列](./problems/46.permutations.md)
210+
- [0047. 全排列 II](./problems/47.permutations-ii.md)
211+
- [0048. 旋转图像](./problems/48.rotate-image.md)
212+
- [0049. 字母异位词分组](./problems/49.group-anagrams.md)
213+
- [0050. Pow(x, n)](./problems/50.pow-x-n.md)
214+
- [0055. 跳跃游戏](./problems/55.jump-game.md)
215+
- [0056. 合并区间](./problems/56.merge-intervals.md)
216+
- [0060. 第 k 个排列](./problems/60.permutation-sequence.md)
217+
- [0061. 旋转链表](./problems/61.Rotate-List.md) 91
218+
- [0062. 不同路径](./problems/62.unique-paths.md)
219+
- [0073. 矩阵置零](./problems/73.set-matrix-zeroes.md)
220+
- [0075. 颜色分类](./problems/75.sort-colors.md)
221+
- [0078. 子集](./problems/78.subsets.md)
222+
- [0079. 单词搜索](./problems/79.word-search.md)
223+
- [0080. 删除排序数组中的重复项 II](./problems/80.remove-duplicates-from-sorted-array-ii.md)
224+
- [0086. 分隔链表](./problems/86.partition-list.md)
225+
- [0090. 子集 II](./problems/90.subsets-ii.md)
226+
- [0091. 解码方法](./problems/91.decode-ways.md)
227+
- [0092. 反转链表 II](./problems/92.reverse-linked-list-ii.md)
228+
- [0094. 二叉树的中序遍历](./problems/94.binary-tree-inorder-traversal.md)
229+
- [0095. 不同的二叉搜索树 II](./problems/95.unique-binary-search-trees-ii.md)
230+
- [0096. 不同的二叉搜索树](./problems/96.unique-binary-search-trees.md)
231+
- [0098. 验证二叉搜索树](./problems/98.validate-binary-search-tree.md)
232+
- [0102. 二叉树的层序遍历](./problems/102.binary-tree-level-order-traversal.md)
233+
- [0103. 二叉树的锯齿形层次遍历](./problems/103.binary-tree-zigzag-level-order-traversal.md)
234+
- [0113. 路径总和 II](./problems/113.path-sum-ii.md)
235+
- [0129. 求根到叶子节点数字之和](./problems/129.sum-root-to-leaf-numbers.md)
236+
- [0130. 被围绕的区域](./problems/130.surrounded-regions.md)
237+
- [0131. 分割回文串](./problems/131.palindrome-partitioning.md)
238+
- [0139. 单词拆分](./problems/139.word-break.md)
239+
- [0144. 二叉树的前序遍历](./problems/144.binary-tree-preorder-traversal.md)
240+
- [0147. 对链表进行插入排序](./problems/147.insertion-sort-list.md) 🆕
241+
- [0150. 逆波兰表达式求值](./problems/150.evaluate-reverse-polish-notation.md)
242+
- [0152. 乘积最大子数组](./problems/152.maximum-product-subarray.md)
243+
- [0199. 二叉树的右视图](./problems/199.binary-tree-right-side-view.md)
244+
- [0200. 岛屿数量](./problems/200.number-of-islands.md)
245+
- [0201. 数字范围按位与](./problems/201.bitwise-and-of-numbers-range.md)
246+
- [0208. 实现 Trie (前缀树)](./problems/208.implement-trie-prefix-tree.md)
247+
- [0209. 长度最小的子数组](./problems/209.minimum-size-subarray-sum.md)
248+
- [0211. 添加与搜索单词 \* 数据结构设计](./problems/211.add-and-search-word-data-structure-design.md)
249+
- [0215. 数组中的第 K 个最大元素](./problems/215.kth-largest-element-in-an-array.md)
250+
- [0221. 最大正方形](./problems/221.maximal-square.md)
251+
- [0227. 基本计算器 II](./problems/227.basic-calculator-ii.md)🆕
252+
- [0229. 求众数 II](./problems/229.majority-element-ii.md)
253+
- [0230. 二叉搜索树中第 K 小的元素](./problems/230.kth-smallest-element-in-a-bst.md)
254+
- [0236. 二叉树的最近公共祖先](./problems/236.lowest-common-ancestor-of-a-binary-tree.md)
255+
- [0238. 除自身以外数组的乘积](./problems/238.product-of-array-except-self.md)
256+
- [0240. 搜索二维矩阵 II](./problems/240.search-a-2-d-matrix-ii.md)
257+
- [0279. 完全平方数](./problems/279.perfect-squares.md)
258+
- [0309. 最佳买卖股票时机含冷冻期](./problems/309.best-time-to-buy-and-sell-stock-with-cooldown.md)
259+
- [0322. 零钱兑换](./problems/322.coin-change.md)
260+
- [0328. 奇偶链表](./problems/328.odd-even-linked-list.md)
261+
- [0334. 递增的三元子序列](./problems/334.increasing-triplet-subsequence.md)
262+
- [0337. 打家劫舍 III](./problems/337.house-robber-iii.md)
263+
- [0343. 整数拆分](./problems/343.integer-break.md)
264+
- [0365. 水壶问题](./problems/365.water-and-jug-problem.md)
265+
- [0378. 有序矩阵中第 K 小的元素](./problems/378.kth-smallest-element-in-a-sorted-matrix.md)
266+
- [0380. 常数时间插入、删除和获取随机元素](./problems/380.insert-delete-getrandom-o1.md)
267+
- [0394. 字符串解码](./problems/394.decode-string.md) 91
268+
- [0416. 分割等和子集](./problems/416.partition-equal-subset-sum.md)
269+
- [0445. 两数相加 II](./problems/445.add-two-numbers-ii.md)
270+
- [0454. 四数相加 II](./problems/454.4-sum-ii.md)
271+
- [0464. 我能赢么](./problems/464.can-i-win.md)
272+
- [0494. 目标和](./problems/494.target-sum.md)
273+
- [0516. 最长回文子序列](./problems/516.longest-palindromic-subsequence.md)
274+
- [0513. 找树左下角的值](./problems/513.find-bottom-left-tree-value.md) 91
275+
- [0518. 零钱兑换 II](./problems/518.coin-change-2.md)
276+
- [0547. 朋友圈](./problems/547.friend-circles.md)
277+
- [0560. 和为 K 的子数组](./problems/560.subarray-sum-equals-k.md)
278+
- [0609. 在系统中查找重复文件](./problems/609.find-duplicate-file-in-system.md)
279+
- [0611. 有效三角形的个数](./problems/611.valid-triangle-number.md)
280+
- [0686. 重复叠加字符串匹配](./problems/686.repeated-string-match.md) 🆕
281+
- [0718. 最长重复子数组](./problems/718.maximum-length-of-repeated-subarray.md)
282+
- [0754. 到达终点数字](./problems/754.reach-a-number.md)
283+
- [0785. 判断二分图](./problems/785.is-graph-bipartite.md)
284+
- [0816. 模糊坐标](./problems/816.ambiguous-coordinates.md) 🆕
285+
- [0820. 单词的压缩编码](./problems/820.short-encoding-of-words.md)
286+
- [0875. 爱吃香蕉的珂珂](./problems/875.koko-eating-bananas.md)
287+
- [0877. 石子游戏](./problems/877.stone-game.md)
288+
- [0886. 可能的二分法](./problems/886.possible-bipartition.md)
289+
- [0900. RLE 迭代器](./problems/900.rle-iterator.md)
290+
- [0911. 在线选举](./problems/911.online-election.md) 🆕
291+
- [0912. 排序数组](./problems/912.sort-an-array.md)
292+
- [0935. 骑士拨号器](./problems/935.knight-dialer.md)
293+
- [0978. 最长湍流子数组](./problems/978.longest-turbulent-subarray.md) 🆕
294+
- [0987. 二叉树的垂序遍历](./problems/987.vertical-order-traversal-of-a-binary-tree.md) 91
295+
- [1011. 在 D 天内送达包裹的能力](./problems/1011.capacity-to-ship-packages-within-d-days.md)
296+
- [1014. 最佳观光组合](./problems/1014.best-sightseeing-pair.md)
297+
- [1015. 可被 K 整除的最小整数](./problems/1015.smallest-integer-divisible-by-k.md)
298+
- [1019. 链表中的下一个更大节点](./problems/1019.next-greater-node-in-linked-list.md)
299+
- [1020. 飞地的数量](./problems/1020.number-of-enclaves.md)
300+
- [1023. 驼峰式匹配](./problems/1023.camelcase-matching.md)
301+
- [1031. 两个非重叠子数组的最大和](./problems/1031.maximum-sum-of-two-non-overlapping-subarrays.md)
302+
- [1104. 二叉树寻路](./problems/1104.path-in-zigzag-labelled-binary-tree.md)
303+
- [1131.绝对值表达式的最大值](./problems/1131.maximum-of-absolute-value-expression.md)
304+
- [1186. 删除一次得到子数组最大和](./problems/1186.maximum-subarray-sum-with-one-deletion.md)
305+
- [1218. 最长定差子序列](./problems/1218.longest-arithmetic-subsequence-of-given-difference.md)
306+
- [1227. 飞机座位分配概率](./problems/1227.airplane-seat-assignment-probability.md)
307+
- [1261. 在受污染的二叉树中查找元素](./problems/1261.find-elements-in-a-contaminated-binary-tree.md)
308+
- [1262. 可被三整除的最大和](./problems/1262.greatest-sum-divisible-by-three.md)
309+
- [1297. 子串的最大出现次数](./problems/1297.maximum-number-of-occurrences-of-a-substring.md)
310+
- [1310. 子数组异或查询](./problems/1310.xor-queries-of-a-subarray.md)
311+
- [1334. 阈值距离内邻居最少的城市](./problems/1334.find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.md)
312+
- [1371.每个元音包含偶数次的最长子字符串](./problems/1371.find-the-longest-substring-containing-vowels-in-even-counts.md)
313+
- [1381. 设计一个支持增量操作的栈](./problems/1381.design-a-stack-with-increment-operation.md) 91
314+
- [1558. 得到目标数组的最少函数调用次数](./problems/1558.minimum-numbers-of-function-calls-to-make-target-array.md) 🆕
315+
- [1574. 删除最短的子数组使剩余数组有序](./problems/1574.shortest-subarray-to-be-removed-to-make-array-sorted.md) 🆕
316+
- [1631. 最小体力消耗路径](./problems/1631.path-with-minimum-effort.md) 🆕
317+
- [1658. 将 x 减到 0 的最小操作数](./problems/1658.minimum-operations-to-reduce-x-to-zero.md) 🆕
318+
319+
#### 困难难度题目合集
320+
321+
困难难度题目从类型上说多是:
322+
323+
-
324+
- 设计题
325+
- 游戏场景题目
326+
- 中等题目的 follow up
327+
328+
从解法上来说,多是:
329+
330+
- 图算法
331+
- 动态规划
332+
- 二分法
333+
- DFS & BFS
334+
- 状态压缩
335+
- 剪枝
336+
337+
从逻辑上说, 要么就是非常难想到,要么就是非常难写代码。 这里我总结了几个技巧:
338+
339+
1. 看题目的数据范围, 看能否暴力模拟
340+
2. 暴力枚举所有可能的算法往上套,比如图的题目。
341+
3. 总结和记忆解题模板,减少解题压力
342+
343+
以下是我列举的经典题目(带 91 字样的表示出自 **91 天学算法**活动):
344+
345+
- [0004. 寻找两个正序数组的中位数](./problems/4.median-of-two-sorted-arrays.md)
346+
- [0023. 合并 K 个升序链表](./problems/23.merge-k-sorted-lists.md)
347+
- [0025. K 个一组翻转链表](./problems/25.reverse-nodes-in-k-groups.md)
348+
- [0030. 串联所有单词的子串](./problems/30.substring-with-concatenation-of-all-words.md)
349+
- [0032. 最长有效括号](./problems/32.longest-valid-parentheses.md)
350+
- [0042. 接雨水](./problems/42.trapping-rain-water.md)
351+
- [0052. N 皇后 II](./problems/52.N-Queens-II.md)
352+
- [0057. 插入区间](problems/57.insert-interval.md) 🆕
353+
- [0084. 柱状图中最大的矩形](./problems/84.largest-rectangle-in-histogram.md)
354+
- [0085. 最大矩形](./problems/85.maximal-rectangle.md)
355+
- [0124. 二叉树中的最大路径和](./problems/124.binary-tree-maximum-path-sum.md)
356+
- [0128. 最长连续序列](./problems/128.longest-consecutive-sequence.md)
357+
- [0140. 单词拆分 II](problems/140.word-break-ii.md) 🆕
358+
- [0145. 二叉树的后序遍历](./problems/145.binary-tree-postorder-traversal.md)
359+
- [0212. 单词搜索 II](./problems/212.word-search-ii.md)
360+
- [0239. 滑动窗口最大值](./problems/239.sliding-window-maximum.md)
361+
- [0295. 数据流的中位数](./problems/295.find-median-from-data-stream.md)
362+
- [0297. 二叉树的序列化与反序列化](./problems/297.serialize-and-deserialize-binary-tree.md) 91
363+
- [0301. 删除无效的括号](./problems/301.remove-invalid-parentheses.md)
364+
- [0312. 戳气球](./problems/312.burst-balloons.md)
365+
- [330. 按要求补齐数组](./problems/330.patching-array.md)
366+
- [0335. 路径交叉](./problems/335.self-crossing.md)
367+
- [0460. LFU 缓存](./problems/460.lfu-cache.md)
368+
- [0472. 连接词](./problems/472.concatenated-words.md)
369+
- [0488. 祖玛游戏](./problems/488.zuma-game.md)
370+
- [0493. 翻转对](./problems/493.reverse-pairs.md)
371+
- [0715. Range 模块](./problems/715.range-module.md) 🆕
372+
- [0768. 最多能完成排序的块 II](./problems/768.max-chunks-to-make-sorted-ii.md) 91
373+
- [0887. 鸡蛋掉落](./problems/887.super-egg-drop.md)
374+
- [0895. 最大频率栈](./problems/895.maximum-frequency-stack.md)
375+
- [0975. 奇偶跳](./problems/975.odd-even-jump.md) 🆕
376+
- [1032. 字符流](./problems/1032.stream-of-characters.md)
377+
- [1168. 水资源分配优化](./problems/1168.optimize-water-distribution-in-a-village.md)
378+
- [1203. 项目管理](./problems/1203.sort-items-by-groups-respecting-dependencies.md) 🆕
379+
- [1255. 得分最高的单词集合](./problems/1255.maximum-score-words-formed-by-letters.md)
380+
- [1345. 跳跃游戏 IV](./problems/1435.jump-game-iv.md)
381+
- [1449. 数位成本和为目标值的最大数字](./problems/1449.form-largest-integer-with-digits-that-add-up-to-target.md) 🆕
382+
- [5640. 与数组中元素的最大异或值](./problems/5640.maximum-xor-with-an-element-from-array.md) 🆕
383+
135384
### 数据结构与算法的总结(22 篇)
136385

137386
- [数据结构总览](./thinkings/basic-data-structure.md)

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@
249249
* [0768. 最多能完成排序的块 II](problems/768.max-chunks-to-make-sorted-ii.md) 91
250250
* [0887. 鸡蛋掉落](problems/887.super-egg-drop.md)
251251
* [0895. 最大频率栈](problems/895.maximum-frequency-stack.md)
252+
* [0975. 奇偶跳](../problems/975.odd-even-jump.md) 🆕
252253
* [1032. 字符流](problems/1032.stream-of-characters.md)
253254
* [1168. 水资源分配优化](problems/1168.optimize-water-distribution-in-a-village.md)
254255
* [1203. 项目管理](../problems/1203.sort-items-by-groups-respecting-dependencies.md) 🆕

0 commit comments

Comments
 (0)