重新分类 Leetcode 高频题 2021 版
- 题目按照面试频率降序排列
- 增加难度分类,适合从简单开始学习
- 增加细分类别,例如单调栈,前缀树等,一道题目可能会有多个类别
- 𐀴 链表
- 单链表
- 双链表
- 𐀴 树
- 遍历
- 构造
- 路径 | 深度 | 翻转
- 二叉搜索树
- 前缀树
-
- 线段树
- 𐀴 栈
- 基础
- 单调栈
- 𐀴 堆
- 基础
- 𐀴 二分查找
- 𐀴 位运算
- 𐀴 双指针与滑动窗口
- 𐀴 矩阵
- 𐀴 动态规划
- 一维
- 二维
- 𐀴 图论
- DFS
- BFS
-
- Dijkstra
- 拓扑排序
- 𐀴 并查集
- 𐀴 设计
- 𐀴 贪心
- 𐀴 回溯
- 𐀴 克隆
- 𐀴 数学
- 𐀴 * 最大最小策略
- 𐀴 * 几何
- 92. 反转链表 II
- 143. 重排链表
- 82. 删除排序链表中的重复元素 II
- 19. 删除链表的倒数第 N 个结点
- 148. 排序链表
- 86. 分隔链表
- 61. 旋转链表
- 142. 环形链表 II
- 147. 对链表进行插入排序
- 138. 复制带随机指针的链表
- 24. 两两交换链表中的节点
- 328. 奇偶链表
- 707. 设计链表
- 109. 有序链表转换二叉搜索树
- 430. 扁平化多级双向链表
- 725. 分隔链表
- 104. 二叉树的最大深度
- 101. 对称二叉树
- 226. 翻转二叉树
- 543. 二叉树的直径
- 257. 二叉树的所有路径
- 110. 平衡二叉树
- 617. 合并二叉树
- 100. 相同的树
- 112. 路径总和
- 111. 二叉树的最小深度
- 236. 二叉树的最近公共祖先
- 222. 完全二叉树的节点个数
- 113. 路径总和 II
- 437. 路径总和 III
- 129. 求根节点到叶节点数字之和
- 662. 二叉树最大宽度
- 114. 二叉树展开为链表
- 199. 二叉树的右视图
- 116. 填充每个节点的下一个右侧节点指针
- 515. 在每个树行中找最大值
- 315. 计算右侧小于当前元素的个数
- 493. 翻转对
- 218. 天际线问题
- 715. Range 模块
- 850. 矩形面积 II
- 1157. 子数组中占绝大多数的元素
- 699. 掉落的方块
- 327. 区间和的个数
- 20. 有效的括号
- 1047. 删除字符串中的所有相邻重复项
- 232. 用栈实现队列
- 155. 最小栈
- 225. 用队列实现栈
- 1021. 删除最外层的括号
- 682. 棒球比赛
- 844. 比较含退格的字符串
- 1190. 反转每对括号间的子串
- 394. 字符串解码 Fail
- 456. 132 模式 Fail
- 227. 基本计算器 II Note: devide and previous sign
- 150. 逆波兰表达式求值 Note: devide
- 503. 下一个更大元素 II Note: concatenate
- 71. 简化路径 Fail
- 856. 括号的分数 Fail
- 907. 子数组的最小值之和
- 385. 迷你语法分析器
- 1249. 移除无效的括号
- 636. 函数的独占时间
- 341. 扁平化嵌套列表迭代器
- 215. 数组中的第 K 个最大元素
- 347. 前 K 个高频元素
- 692. 前K个高频单词
- 378. 有序矩阵中第 K 小的元素
- 451. 根据字符出现频率排序
- 743. 网络延迟时间
- 787. K 站中转内最便宜的航班
- 973. 最接近原点的 K 个点
- 300. 最长递增子序列
- 74. 搜索二维矩阵
- 34. 在排序数组中查找元素的第一个和最后一个位置
- 81. 搜索旋转排序数组 II
- 33. 搜索旋转排序数组
- 454. 四数相加 II
- 240. 搜索二维矩阵 II
- 718. 最长重复子数组
- 50. Pow(x, n)
- 29. 两数相除
- 287. 寻找重复数
- 209. 长度最小的子数组
- 153. 寻找旋转排序数组中的最小值
- 162. 寻找峰值
- 378. 有序矩阵中第 K 小的元素
- 230. 二叉搜索树中第K小的元素
- 136. 只出现一次的数字
- 191. 位1的个数
- 169. 多数元素
- 190. 颠倒二进制位
- 231. 2的幂
- 389. 找不同
- 461. 汉明距离
- 405. 数字转换为十六进制数
- 268. 丢失的数字
- 78. 子集
- 338. 比特位计数
- 1318. 或运算的最小翻转次数
- 89. 格雷编码
- 260. 只出现一次的数字 III
- 371. 两整数之和
- 137. 只出现一次的数字 II
- 421. 数组中两个数的最大异或值
- 387. 字符串中的第一个唯一字符
- 349. 两个数组的交集
- 409. 最长回文串
- 217. 存在重复元素
- 204. 计数质数
- 88. 合并两个有序数组
- 283. 移动零
- 125. 验证回文串
- 344. 反转字符串
- 27. 移除元素
- 977. 有序数组的平方
- 3. 无重复字符的最长子串
- 781. 森林中的兔子
- 49. 字母异位词分组
- 18. 四数之和
- 560. 和为 K 的子数组
- 454. 四数相加 II
- 11. 盛最多水的容器
- 16. 最接近的三数之和
- 18. 四数之和
- 424. 替换后的最长重复字符
- 713. 乘积小于K的子数组
- 337. 打家劫舍 III
- 322. 零钱兑换
- 300. 最长递增子序列
- 139. 单词拆分
- 152. 乘积最大子数组
- 338. 比特位计数
- 309. 最佳买卖股票时机含冷冻期
- 264. 丑数 II
- 279. 完全平方数
- 394. 字符串解码
- 721. 账户合并
- 547. 省份数量
- 494. 目标和
- 695. 岛屿的最大面积
- 130. 被围绕的区域
- 1631. 最小体力消耗路径
- 207. 课程表
- 417. 太平洋大西洋水流问题
- 279. 完全平方数 candidate number(num ** 0.5)
- 130. 被围绕的区域
- 1319. 连通网络的操作次数 count component
- 934. 最短的桥
- 785. 判断二分图 for each node, we need to check mark or not.
- 994. 腐烂的橘子
- 752. 打开转盘锁
- 1162. 地图分析 if len(q) == n * n or len(q) == 0: return -1
- 529. 扫雷游戏 if count: continue. skip the one with number.
- 46. 全排列
- 22. 括号生成
- 93. 复原 IP 地址
- 78. 子集
- 17. 电话号码的字母组合
- 79. 单词搜索
- 90. 子集 II
- 39. 组合总和
- 77. 组合
- 40. 组合总和 II
- 47. 全排列 II
- 842. 将数组拆分成斐波那契序列
- 216. 组合总和 III
- 89. 格雷编码
数组:
-
Sort an Array (Quick Sort and Merge Sort) https://leetcode.com/problems/sort-an-array/
-
Sort Colors https://leetcode.com/problems/sort-colors/
-
Remove Duplicates from Sorted Array https://leetcode.com/problems/re ... -from-sorted-array/
-
Remove Duplicates from Sorted Array II https://leetcode.com/problems/re ... om-sorted-array-ii/
-
Merge Sorted Array https://leetcode.com/problems/merge-sorted-array/
-
Move Zeroes https://leetcode.com/problems/move-zeroes/
-
Kth Largest Element in an Array https://leetcode.com/problems/kth-largest-element-in-an-array/
-
Top K Frequent Elements https://leetcode.com/problems/top-k-frequent-elements/
-
Intersection of Two Arrays https://leetcode.com/problems/intersection-of-two-arrays/
-
Intersection of Two Arrays II https://leetcode.com/problems/intersection-of-two-arrays-ii/
-
Longest Mountain in Array https://leetcode.com/problems/longest-mountain-in-array/
-
Trapping Rain Water https://leetcode.com/problems/trapping-rain-water/
-
Multiply Strings https://leetcode.com/problems/multiply-strings/
-
Pancake Sorting https://leetcode.com/problems/pancake-sorting/
Lint-31. Partition Array https://www.lintcode.com/problem/partition-array/description
Lint-625. Partition Array II https://www.lintcode.com/problem/partition-array-ii/description
Lint-143. Sort Color II https://www.lintcode.com/problem/sort-colors-ii/description
Lint-461. Kth Smallest Numbers in Unsorted Array https://www.lintcode.com/problem ... d-array/description
Lint-544. Top k Largest Numbers https://www.lintcode.com/problem ... numbers/description
链表:
-
Merge Two Sorted Lists https://leetcode.com/problems/merge-two-sorted-lists/
-
Partition List https://leetcode.com/problems/partition-list/
-
Linked List Cycle https://leetcode.com/problems/linked-list-cycle/
-
Intersection of Two Linked Lists https://leetcode.com/problems/intersection-of-two-linked-lists/
-
Palindrome Linked List https://leetcode.com/problems/palindrome-linked-list/
-
Odd Even Linked List https://leetcode.com/problems/odd-even-linked-list/
-
Linked List Cycle II https://leetcode.com/problems/linked-list-cycle-ii/
-
Find the Duplicate Number https://leetcode.com/problems/find-the-duplicate-number/
-
Middle of the Linked List https://leetcode.com/problems/middle-of-the-linked-list/
区间:
Lint-391. Number of Airplanes in the Sky https://www.lintcode.com/problem ... the-sky/description
-
Merge Intervals https://leetcode.com/problems/merge-intervals/
-
Insert Interval https://leetcode.com/problems/insert-interval/
-
Meeting Rooms https://leetcode.com/problems/meeting-rooms/
-
Meeting Rooms II https://leetcode.com/problems/meeting-rooms-ii/
-
Interval List Intersections https://leetcode.com/problems/interval-list-intersections/
回文串:
-
Longest Palindromic Substring https://leetcode.com/problems/longest-palindromic-substring/
-
Reverse Vowels of a String https://leetcode.com/problems/reverse-vowels-of-a-string/
-
Valid Palindrome II https://leetcode.com/problems/valid-palindrome-ii/
-
Valid Palindrome https://leetcode.com/problems/valid-palindrome/
滑动窗口:
-
Longest Substring Without Repeating Characters https://leetcode.com/problems/lo ... peating-characters/
-
Container With Most Water https://leetcode.com/problems/container-with-most-water/
-
Minimum Window Substring https://leetcode.com/problems/minimum-window-substring/
-
Minimum Size Subarray Sum https://leetcode.com/problems/minimum-size-subarray-sum/
-
Sliding Window Maximum https://leetcode.com/problems/sliding-window-maximum/
-
Subarray Product Less Than K https://leetcode.com/problems/subarray-product-less-than-k/
-
Longest Substring with At Least K Repeating Characters https://leetcode.com/problems/lo ... peating-characters/
-
Sliding Window Median https://leetcode.com/problems/sliding-window-median/
-
Permutation in String https://leetcode.com/problems/permutation-in-string/
-
Minimum Window Subsequence https://leetcode.com/problems/minimum-window-subsequence/
Lint-604. Window Sum https://www.lintcode.com/problem/window-sum/description
流:
-
Find Median from Data Stream https://leetcode.com/problems/find-median-from-data-stream/
-
Moving Average from Data Stream https://leetcode.com/problems/moving-average-from-data-stream/
-
Data Stream as Disjoint Intervals https://leetcode.com/problems/data-stream-as-disjoint-intervals/
-
Kth Largest Element in a Stream https://leetcode.com/problems/kth-largest-element-in-a-stream/
前项和:
-
Maximum Subarray https://leetcode.com/problems/maximum-subarray/
-
Product of Array Except Self https://leetcode.com/problems/product-of-array-except-self/
-
Range Sum Query - Immutable https://leetcode.com/problems/range-sum-query-immutable/
-
Maximum Size Subarray Sum Equals k https://leetcode.com/problems/maximum-size-subarray-sum-equals-k/
-
Random Pick with Weight https://leetcode.com/problems/random-pick-with-weight/
-
Subarray Sum Equals K https://leetcode.com/problems/subarray-sum-equals-k/
和差问题:
Lint-382. Triangle Count https://www.lintcode.com/problem/triangle-count/description
-
Two Sum II - Input array is sorted https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/
-
Two Sum III - Data structure design https://leetcode.com/problems/two-sum-iii-data-structure-design/
-
Two Sum IV - Input is a BST https://leetcode.com/problems/two-sum-iv-input-is-a-bst/
-
Two Sum Less Than K https://leetcode.com/problems/two-sum-less-than-k/
-
3Sum Smaller https://leetcode.com/problems/3sum-smaller/
Lint-57. 3Sum Closest https://www.lintcode.com/problem/3sum-closest/description
Lint-443. Two Sum - Greater than target https://www.lintcode.com/problem ... -target/description
Lint-533. Two Sum - Closet to target https://www.lintcode.com/problem ... -target/description
Lint-587. Two Sum - Unique pairs https://www.lintcode.com/problem/two-sum-unique-pairs/description
Lint-609. Two Sum - Less than or equals to target https://www.lintcode.com/problem ... -target/description
Lint-610. Two Sum - Difference equals to target https://www.lintcode.com/problem ... rget/my-submissions