跳至主要內容

面试进阶 300 题


链表

  • 单链表
题号标题题解标签难度力扣
206反转链表[✓]递归 链表🟢🀄️open in new window 🔗open in new window
141环形链表[✓]哈希表 链表 双指针🟢🀄️open in new window 🔗open in new window
83删除排序链表中的重复元素[✓]链表🟢🀄️open in new window 🔗open in new window
234回文链表[✓] 递归 链表 1+🟢🀄️open in new window 🔗open in new window
203移除链表元素[✓]递归 链表🟢🀄️open in new window 🔗open in new window
237删除链表中的节点[✓]链表🟠🀄️open in new window 🔗open in new window
876链表的中间结点[✓]链表 双指针🟢🀄️open in new window 🔗open in new window
92反转链表 II[✓]链表🟠🀄️open in new window 🔗open in new window
143重排链表[✓] 递归 链表 1+🟠🀄️open in new window 🔗open in new window
82删除排序链表中的重复元素 II[✓]链表 双指针🟠🀄️open in new window 🔗open in new window
19删除链表的倒数第 N 个结点[✓]链表 双指针🟠🀄️open in new window 🔗open in new window
148排序链表[✓]链表 双指针 分治 2+🟠🀄️open in new window 🔗open in new window
86分隔链表[✓]链表 双指针🟠🀄️open in new window 🔗open in new window
61旋转链表[✓]链表 双指针🟠🀄️open in new window 🔗open in new window
142环形链表 II[✓]哈希表 链表 双指针🟠🀄️open in new window 🔗open in new window
147对链表进行插入排序[✓]链表 排序🟠🀄️open in new window 🔗open in new window
138随机链表的复制[✓]哈希表 链表🟠🀄️open in new window 🔗open in new window
24两两交换链表中的节点[✓]递归 链表🟠🀄️open in new window 🔗open in new window
328奇偶链表[✓]链表🟠🀄️open in new window 🔗open in new window
707设计链表[✓]设计 链表🟠🀄️open in new window 🔗open in new window
109有序链表转换二叉搜索树[✓] 二叉搜索树 链表 2+🟠🀄️open in new window 🔗open in new window
430扁平化多级双向链表[✓]深度优先搜索 链表 双向链表🟠🀄️open in new window 🔗open in new window
725分隔链表链表🟠🀄️open in new window 🔗open in new window
25K 个一组翻转链表[✓]递归 链表🔴🀄️open in new window 🔗open in new window
  • 双链表
题号标题题解标签难度力扣
21合并两个有序链表[✓]递归 链表🟢🀄️open in new window 🔗open in new window
160相交链表[✓]哈希表 链表 双指针🟢🀄️open in new window 🔗open in new window
2两数相加[✓]递归 链表 数学🟠🀄️open in new window 🔗open in new window
445两数相加 II[✓] 链表 数学🟠🀄️open in new window 🔗open in new window
1669合并两个链表链表🟠🀄️open in new window 🔗open in new window
23合并 K 个升序链表[✓]链表 分治 堆(优先队列) 1+🔴🀄️open in new window 🔗open in new window

  • 遍历
题号标题题解标签难度力扣
145二叉树的后序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
94二叉树的中序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
589N 叉树的前序遍历[✓] 深度优先搜索🟢🀄️open in new window 🔗open in new window
144二叉树的前序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
590N 叉树的后序遍历[✓] 深度优先搜索🟢🀄️open in new window 🔗open in new window
102二叉树的层序遍历[✓] 广度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
103二叉树的锯齿形层序遍历[✓] 广度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
107二叉树的层序遍历 II[✓] 广度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
  • 构造
题号标题题解标签难度力扣
108将有序数组转换为二叉搜索树[✓] 二叉搜索树 数组 2+🟢🀄️open in new window 🔗open in new window
105从前序与中序遍历序列构造二叉树[✓] 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
106从中序与后序遍历序列构造二叉树[✓] 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
114二叉树展开为链表[✓] 深度优先搜索 2+🟠🀄️open in new window 🔗open in new window
889根据前序和后序遍历构造二叉树[✓] 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1008前序遍历构造二叉搜索树[✓] 二叉搜索树 3+🟠🀄️open in new window 🔗open in new window
297二叉树的序列化与反序列化[✓] 深度优先搜索 广度优先搜索 3+🔴🀄️open in new window 🔗open in new window
  • 路径 | 深度 | 翻转
题号标题题解标签难度力扣
104二叉树的最大深度[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
101对称二叉树[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
226翻转二叉树[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
543二叉树的直径[✓] 深度优先搜索 二叉树🟢🀄️open in new window 🔗open in new window
257二叉树的所有路径[✓] 深度优先搜索 字符串 2+🟢🀄️open in new window 🔗open in new window
110平衡二叉树[✓] 深度优先搜索 二叉树🟢🀄️open in new window 🔗open in new window
617合并二叉树[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
100相同的树[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
112路径总和[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
111二叉树的最小深度[✓] 深度优先搜索 广度优先搜索 1+🟢🀄️open in new window 🔗open in new window
236二叉树的最近公共祖先[✓] 深度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
222完全二叉树的节点个数[✓]位运算 二分查找 1+🟢🀄️open in new window 🔗open in new window
113路径总和 II[✓] 深度优先搜索 回溯 1+🟠🀄️open in new window 🔗open in new window
437路径总和 III[✓] 深度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
129求根节点到叶节点数字之和[✓] 深度优先搜索 二叉树🟠🀄️open in new window 🔗open in new window
662二叉树最大宽度[✓] 深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
114二叉树展开为链表[✓] 深度优先搜索 2+🟠🀄️open in new window 🔗open in new window
199二叉树的右视图[✓] 深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
116填充每个节点的下一个右侧节点指针[✓] 深度优先搜索 广度优先搜索 2+🟠🀄️open in new window 🔗open in new window
515在每个树行中找最大值 深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
124二叉树中的最大路径和[✓] 深度优先搜索 动态规划 1+🔴🀄️open in new window 🔗open in new window
297二叉树的序列化与反序列化[✓] 深度优先搜索 广度优先搜索 3+🔴🀄️open in new window 🔗open in new window
  • 二叉搜索树
题号标题题解标签难度力扣
108将有序数组转换为二叉搜索树[✓] 二叉搜索树 数组 2+🟢🀄️open in new window 🔗open in new window
98验证二叉搜索树[✓] 深度优先搜索 二叉搜索树 1+🟠🀄️open in new window 🔗open in new window
96不同的二叉搜索树[✓] 二叉搜索树 数学 2+🟠🀄️open in new window 🔗open in new window
95不同的二叉搜索树 II[✓] 二叉搜索树 动态规划 2+🟠🀄️open in new window 🔗open in new window
173二叉搜索树迭代器[✓] 设计 3+🟠🀄️open in new window 🔗open in new window
230二叉搜索树中第 K 小的元素[✓] 深度优先搜索 二叉搜索树 1+🟠🀄️open in new window 🔗open in new window
99恢复二叉搜索树[✓] 深度优先搜索 二叉搜索树 1+🟠🀄️open in new window 🔗open in new window
  • 字典树
题号标题题解标签难度力扣
720词典中最长的单词字典树 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
208实现 Trie (前缀树)[✓]设计 字典树 哈希表 1+🟠🀄️open in new window 🔗open in new window
692前K个高频单词字典树 哈希表 字符串 4+🟠🀄️open in new window 🔗open in new window
421数组中两个数的最大异或值位运算 字典树 数组 1+🟠🀄️open in new window 🔗open in new window
212单词搜索 II[✓]字典树 数组 字符串 2+🔴🀄️open in new window 🔗open in new window
  • 线段树
题号标题题解标签难度力扣
1353最多可以参加的会议数目贪心 数组 排序 1+🟠🀄️open in new window 🔗open in new window
307区域和检索 - 数组可修改[✓]设计 树状数组 线段树 1+🟠🀄️open in new window 🔗open in new window
315计算右侧小于当前元素的个数树状数组 线段树 数组 4+🔴🀄️open in new window 🔗open in new window
493翻转对树状数组 线段树 数组 4+🔴🀄️open in new window 🔗open in new window
218天际线问题树状数组 线段树 数组 4+🔴🀄️open in new window 🔗open in new window
715Range 模块设计 线段树 有序集合🔴🀄️open in new window 🔗open in new window
850矩形面积 II线段树 数组 有序集合 1+🔴🀄️open in new window 🔗open in new window
1157子数组中占绝大多数的元素设计 树状数组 线段树 2+🔴🀄️open in new window 🔗open in new window
699掉落的方块线段树 数组 有序集合🔴🀄️open in new window 🔗open in new window
327区间和的个数树状数组 线段树 数组 4+🔴🀄️open in new window 🔗open in new window

  • 基础
题号标题题解标签难度力扣
20有效的括号[✓] 字符串🟢🀄️open in new window 🔗open in new window
1047删除字符串中的所有相邻重复项[✓] 字符串🟢🀄️open in new window 🔗open in new window
232用栈实现队列[✓] 设计 队列🟢🀄️open in new window 🔗open in new window
155最小栈[✓] 设计🟠🀄️open in new window 🔗open in new window
225用队列实现栈[✓] 设计 队列🟢🀄️open in new window 🔗open in new window
1021删除最外层的括号[✓] 字符串🟢🀄️open in new window 🔗open in new window
682棒球比赛[✓] 数组 模拟🟢🀄️open in new window 🔗open in new window
844比较含退格的字符串[✓] 双指针 字符串 1+🟢🀄️open in new window 🔗open in new window
1190反转每对括号间的子串[✓] 字符串🟠🀄️open in new window 🔗open in new window
394字符串解码[✓] 递归 字符串🟠🀄️open in new window 🔗open in new window
456132 模式 数组 二分查找 2+🟠🀄️open in new window 🔗open in new window
227基本计算器 II[✓] 数学 字符串🟠🀄️open in new window 🔗open in new window
150逆波兰表达式求值[✓] 数组 数学🟠🀄️open in new window 🔗open in new window
503下一个更大元素 II[✓] 数组 单调栈🟠🀄️open in new window 🔗open in new window
71简化路径[✓] 字符串🟠🀄️open in new window 🔗open in new window
856括号的分数 字符串🟠🀄️open in new window 🔗open in new window
907子数组的最小值之和 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
385迷你语法分析器 深度优先搜索 字符串🟠🀄️open in new window 🔗open in new window
1249移除无效的括号 字符串🟠🀄️open in new window 🔗open in new window
636函数的独占时间 数组🟠🀄️open in new window 🔗open in new window
341扁平化嵌套列表迭代器 深度优先搜索 3+🟠🀄️open in new window 🔗open in new window
224基本计算器[✓] 递归 数学 1+🔴🀄️open in new window 🔗open in new window
726原子的数量 哈希表 字符串 1+🔴🀄️open in new window 🔗open in new window
  • 单调栈
题号标题题解标签难度力扣
496下一个更大元素 I[✓] 数组 哈希表 1+🟢🀄️open in new window 🔗open in new window
739每日温度[✓] 数组 单调栈🟠🀄️open in new window 🔗open in new window
402移掉 K 位数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
316去除重复字母[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
1124表现良好的最长时间段 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
42接雨水[✓] 数组 双指针 2+🔴🀄️open in new window 🔗open in new window
84柱状图中最大的矩形[✓] 数组 单调栈🔴🀄️open in new window 🔗open in new window
85最大矩形[✓] 数组 动态规划 2+🔴🀄️open in new window 🔗open in new window
321拼接最大数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window

  • 基础
题号标题题解标签难度力扣
1046最后一块石头的重量数组 堆(优先队列)🟢🀄️open in new window 🔗open in new window
703数据流中的第 K 大元素[✓] 设计 二叉搜索树 3+🟢🀄️open in new window 🔗open in new window
215数组中的第K个最大元素[✓]数组 分治 快速选择 2+🟠🀄️open in new window 🔗open in new window
347前 K 个高频元素[✓]数组 哈希表 分治 5+🟠🀄️open in new window 🔗open in new window
692前K个高频单词字典树 哈希表 字符串 4+🟠🀄️open in new window 🔗open in new window
378有序矩阵中第 K 小的元素[✓]数组 二分查找 矩阵 2+🟠🀄️open in new window 🔗open in new window
451根据字符出现频率排序[✓]哈希表 字符串 桶排序 3+🟠🀄️open in new window 🔗open in new window
743网络延迟时间深度优先搜索 广度优先搜索 2+🟠🀄️open in new window 🔗open in new window
787K 站中转内最便宜的航班深度优先搜索 广度优先搜索 3+🟠🀄️open in new window 🔗open in new window
973最接近原点的 K 个点[✓]几何 数组 数学 4+🟠🀄️open in new window 🔗open in new window
239滑动窗口最大值[✓]队列 数组 滑动窗口 2+🔴🀄️open in new window 🔗open in new window
295数据流的中位数[✓]设计 双指针 数据流 2+🔴🀄️open in new window 🔗open in new window
218天际线问题树状数组 线段树 数组 4+🔴🀄️open in new window 🔗open in new window

二分查找

题号标题题解标签难度力扣
69x 的平方根[✓]数学 二分查找🟢🀄️open in new window 🔗open in new window
704二分查找[✓]数组 二分查找🟢🀄️open in new window 🔗open in new window
35搜索插入位置[✓]数组 二分查找🟢🀄️open in new window 🔗open in new window
349两个数组的交集数组 哈希表 双指针 2+🟢🀄️open in new window 🔗open in new window
167两数之和 II - 输入有序数组[✓]数组 双指针 二分查找🟠🀄️open in new window 🔗open in new window
278第一个错误的版本[✓]二分查找 交互🟢🀄️open in new window 🔗open in new window
300最长递增子序列[✓]数组 二分查找 动态规划🟠🀄️open in new window 🔗open in new window
74搜索二维矩阵[✓]数组 二分查找 矩阵🟠🀄️open in new window 🔗open in new window
34在排序数组中查找元素的第一个和最后一个位置[✓]数组 二分查找🟠🀄️open in new window 🔗open in new window
81搜索旋转排序数组 II[✓]数组 二分查找🟠🀄️open in new window 🔗open in new window
33搜索旋转排序数组[✓]数组 二分查找🟠🀄️open in new window 🔗open in new window
454四数相加 II数组 哈希表🟠🀄️open in new window 🔗open in new window
240搜索二维矩阵 II[✓]数组 二分查找 分治 1+🟠🀄️open in new window 🔗open in new window
718最长重复子数组数组 二分查找 动态规划 3+🟠🀄️open in new window 🔗open in new window
50Pow(x, n)[✓]递归 数学🟠🀄️open in new window 🔗open in new window
29两数相除[✓]位运算 数学🟠🀄️open in new window 🔗open in new window
287寻找重复数[✓]位运算 数组 双指针 1+🟠🀄️open in new window 🔗open in new window
209长度最小的子数组[✓]数组 二分查找 前缀和 1+🟠🀄️open in new window 🔗open in new window
153寻找旋转排序数组中的最小值[✓]数组 二分查找🟠🀄️open in new window 🔗open in new window
162寻找峰值[✓]数组 二分查找🟠🀄️open in new window 🔗open in new window
378有序矩阵中第 K 小的元素[✓]数组 二分查找 矩阵 2+🟠🀄️open in new window 🔗open in new window
230二叉搜索树中第 K 小的元素[✓] 深度优先搜索 二叉搜索树 1+🟠🀄️open in new window 🔗open in new window
4寻找两个正序数组的中位数[✓]数组 二分查找 分治🔴🀄️open in new window 🔗open in new window
887鸡蛋掉落数学 二分查找 动态规划🔴🀄️open in new window 🔗open in new window
410分割数组的最大值贪心 数组 二分查找 2+🔴🀄️open in new window 🔗open in new window
154寻找旋转排序数组中的最小值 II[✓]数组 二分查找🔴🀄️open in new window 🔗open in new window

位运算

题号标题题解标签难度力扣
136只出现一次的数字[✓]位运算 数组🟢🀄️open in new window 🔗open in new window
191位1的个数[✓]位运算 分治🟢🀄️open in new window 🔗open in new window
169多数元素[✓]数组 哈希表 分治 2+🟢🀄️open in new window 🔗open in new window
190颠倒二进制位[✓]位运算 分治🟢🀄️open in new window 🔗open in new window
2312 的幂位运算 递归 数学🟢🀄️open in new window 🔗open in new window
389找不同位运算 哈希表 字符串 1+🟢🀄️open in new window 🔗open in new window
461汉明距离位运算🟢🀄️open in new window 🔗open in new window
405数字转换为十六进制数位运算 数学🟢🀄️open in new window 🔗open in new window
268丢失的数字[✓]位运算 数组 哈希表 3+🟢🀄️open in new window 🔗open in new window
78子集[✓]位运算 数组 回溯🟠🀄️open in new window 🔗open in new window
338比特位计数[✓]位运算 动态规划🟢🀄️open in new window 🔗open in new window
1318或运算的最小翻转次数[✓]位运算🟠🀄️open in new window 🔗open in new window
89格雷编码位运算 数学 回溯🟠🀄️open in new window 🔗open in new window
260只出现一次的数字 III位运算 数组🟠🀄️open in new window 🔗open in new window
371两整数之和位运算 数学🟠🀄️open in new window 🔗open in new window
137只出现一次的数字 II[✓]位运算 数组🟠🀄️open in new window 🔗open in new window
421数组中两个数的最大异或值位运算 字典树 数组 1+🟠🀄️open in new window 🔗open in new window

双指针与滑动窗口

题号标题题解标签难度力扣
387字符串中的第一个唯一字符队列 哈希表 字符串 1+🟢🀄️open in new window 🔗open in new window
349两个数组的交集数组 哈希表 双指针 2+🟢🀄️open in new window 🔗open in new window
409最长回文串贪心 哈希表 字符串🟢🀄️open in new window 🔗open in new window
217存在重复元素[✓]数组 哈希表 排序🟢🀄️open in new window 🔗open in new window
204计数质数数组 数学 枚举 1+🟠🀄️open in new window 🔗open in new window
88合并两个有序数组[✓]数组 双指针 排序🟢🀄️open in new window 🔗open in new window
283移动零[✓]数组 双指针🟢🀄️open in new window 🔗open in new window
125验证回文串[✓]双指针 字符串🟢🀄️open in new window 🔗open in new window
344反转字符串[✓]双指针 字符串🟢🀄️open in new window 🔗open in new window
27移除元素[✓]数组 双指针🟢🀄️open in new window 🔗open in new window
977有序数组的平方数组 双指针 排序🟢🀄️open in new window 🔗open in new window
3无重复字符的最长子串[✓]哈希表 字符串 滑动窗口🟠🀄️open in new window 🔗open in new window
781森林中的兔子贪心 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
49字母异位词分组[✓]数组 哈希表 字符串 1+🟠🀄️open in new window 🔗open in new window
18四数之和[✓]数组 双指针 排序🟠🀄️open in new window 🔗open in new window
560和为 K 的子数组[✓]数组 哈希表 前缀和🟠🀄️open in new window 🔗open in new window
454四数相加 II数组 哈希表🟠🀄️open in new window 🔗open in new window
11盛最多水的容器[✓]贪心 数组 双指针🟠🀄️open in new window 🔗open in new window
16最接近的三数之和[✓]数组 双指针 排序🟠🀄️open in new window 🔗open in new window
18四数之和[✓]数组 双指针 排序🟠🀄️open in new window 🔗open in new window
424替换后的最长重复字符哈希表 字符串 滑动窗口🟠🀄️open in new window 🔗open in new window
713乘积小于 K 的子数组数组 二分查找 前缀和 1+🟠🀄️open in new window 🔗open in new window
76最小覆盖子串[✓]哈希表 字符串 滑动窗口🔴🀄️open in new window 🔗open in new window
992K 个不同整数的子数组数组 哈希表 计数 1+🔴🀄️open in new window 🔗open in new window

矩阵

题号标题题解标签难度力扣
867转置矩阵数组 矩阵 模拟🟢🀄️open in new window 🔗open in new window
832翻转图像位运算 数组 双指针 2+🟢🀄️open in new window 🔗open in new window
54螺旋矩阵[✓]数组 矩阵 模拟🟠🀄️open in new window 🔗open in new window
59螺旋矩阵 II[✓]数组 矩阵 模拟🟠🀄️open in new window 🔗open in new window
73矩阵置零[✓]数组 哈希表 矩阵🟠🀄️open in new window 🔗open in new window
48旋转图像[✓]数组 数学 矩阵🟠🀄️open in new window 🔗open in new window

动态规划

  • 一维
题号标题题解标签难度力扣
70爬楼梯[✓]记忆化搜索 数学 动态规划🟢🀄️open in new window 🔗open in new window
53最大子数组和[✓]数组 分治 动态规划🟠🀄️open in new window 🔗open in new window
121买卖股票的最佳时机[✓]数组 动态规划🟢🀄️open in new window 🔗open in new window
746使用最小花费爬楼梯[✓]数组 动态规划🟢🀄️open in new window 🔗open in new window
337打家劫舍 III 深度优先搜索 动态规划 1+🟠🀄️open in new window 🔗open in new window
322零钱兑换[✓]广度优先搜索 数组 动态规划🟠🀄️open in new window 🔗open in new window
300最长递增子序列[✓]数组 二分查找 动态规划🟠🀄️open in new window 🔗open in new window
139单词拆分[✓]字典树 记忆化搜索 数组 3+🟠🀄️open in new window 🔗open in new window
152乘积最大子数组[✓]数组 动态规划🟠🀄️open in new window 🔗open in new window
338比特位计数[✓]位运算 动态规划🟢🀄️open in new window 🔗open in new window
309买卖股票的最佳时机含冷冻期[✓]数组 动态规划🟠🀄️open in new window 🔗open in new window
264丑数 II[✓]哈希表 数学 动态规划 1+🟠🀄️open in new window 🔗open in new window
279完全平方数[✓]广度优先搜索 数学 动态规划🟠🀄️open in new window 🔗open in new window
32最长有效括号[✓] 字符串 动态规划🔴🀄️open in new window 🔗open in new window
354俄罗斯套娃信封问题[✓]数组 二分查找 动态规划 1+🔴🀄️open in new window 🔗open in new window
123买卖股票的最佳时机 III[✓]数组 动态规划🔴🀄️open in new window 🔗open in new window
  • 二维
题号标题题解标签难度力扣
5最长回文子串[✓]双指针 字符串 动态规划🟠🀄️open in new window 🔗open in new window
1143最长公共子序列[✓]字符串 动态规划🟠🀄️open in new window 🔗open in new window
131分割回文串[✓]字符串 动态规划 回溯🟠🀄️open in new window 🔗open in new window
62不同路径[✓]数学 动态规划 组合数学🟠🀄️open in new window 🔗open in new window
64最小路径和[✓]数组 动态规划 矩阵🟠🀄️open in new window 🔗open in new window
221最大正方形[✓]数组 动态规划 矩阵🟠🀄️open in new window 🔗open in new window
416分割等和子集[✓]数组 动态规划🟠🀄️open in new window 🔗open in new window
718最长重复子数组数组 二分查找 动态规划 3+🟠🀄️open in new window 🔗open in new window
494目标和[✓]数组 动态规划 回溯🟠🀄️open in new window 🔗open in new window
10正则表达式匹配[✓]递归 字符串 动态规划🔴🀄️open in new window 🔗open in new window
72编辑距离[✓]字符串 动态规划🟠🀄️open in new window 🔗open in new window
887鸡蛋掉落数学 二分查找 动态规划🔴🀄️open in new window 🔗open in new window
132分割回文串 II字符串 动态规划🔴🀄️open in new window 🔗open in new window
44通配符匹配[✓]贪心 递归 字符串 1+🔴🀄️open in new window 🔗open in new window
410分割数组的最大值贪心 数组 二分查找 2+🔴🀄️open in new window 🔗open in new window

图论

  • DFS
题号标题题解标签难度力扣
394字符串解码[✓] 递归 字符串🟠🀄️open in new window 🔗open in new window
721账户合并深度优先搜索 广度优先搜索 并查集 4+🟠🀄️open in new window 🔗open in new window
547省份数量深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
494目标和[✓]数组 动态规划 回溯🟠🀄️open in new window 🔗open in new window
695岛屿的最大面积[✓]深度优先搜索 广度优先搜索 并查集 2+🟠🀄️open in new window 🔗open in new window
130被围绕的区域[✓]深度优先搜索 广度优先搜索 并查集 2+🟠🀄️open in new window 🔗open in new window
1631最小体力消耗路径深度优先搜索 广度优先搜索 并查集 4+🟠🀄️open in new window 🔗open in new window
207课程表[✓]深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
417太平洋大西洋水流问题深度优先搜索 广度优先搜索 数组 1+🟠🀄️open in new window 🔗open in new window
67924 点游戏数组 数学 回溯🔴🀄️open in new window 🔗open in new window
  • BFS
题号标题题解标签难度力扣
690员工的重要性 深度优先搜索 广度优先搜索 2+🟠🀄️open in new window 🔗open in new window
279完全平方数[✓]广度优先搜索 数学 动态规划🟠🀄️open in new window 🔗open in new window
130被围绕的区域[✓]深度优先搜索 广度优先搜索 并查集 2+🟠🀄️open in new window 🔗open in new window
1319连通网络的操作次数深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
934最短的桥深度优先搜索 广度优先搜索 数组 1+🟠🀄️open in new window 🔗open in new window
785判断二分图深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
994腐烂的橘子[✓]广度优先搜索 数组 矩阵🟠🀄️open in new window 🔗open in new window
752打开转盘锁广度优先搜索 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
1162地图分析广度优先搜索 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
529扫雷游戏深度优先搜索 广度优先搜索 数组 1+🟠🀄️open in new window 🔗open in new window
815公交路线广度优先搜索 数组 哈希表🔴🀄️open in new window 🔗open in new window
127单词接龙[✓]广度优先搜索 哈希表 字符串🔴🀄️open in new window 🔗open in new window
1293网格中的最短路径广度优先搜索 数组 矩阵🔴🀄️open in new window 🔗open in new window
773滑动谜题广度优先搜索 数组 矩阵🔴🀄️open in new window 🔗open in new window
827最大人工岛深度优先搜索 广度优先搜索 并查集 2+🔴🀄️open in new window 🔗open in new window
787K 站中转内最便宜的航班深度优先搜索 广度优先搜索 3+🟠🀄️open in new window 🔗open in new window
  • 拓扑排序
题号标题题解标签难度力扣
207课程表[✓]深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
210课程表 II[✓]深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
329矩阵中的最长递增路径深度优先搜索 广度优先搜索 5+🔴🀄️open in new window 🔗open in new window
1203项目管理深度优先搜索 广度优先搜索 1+🔴🀄️open in new window 🔗open in new window

并查集

题号标题题解标签难度力扣
200岛屿数量[✓]深度优先搜索 广度优先搜索 并查集 2+🟠🀄️open in new window 🔗open in new window
721账户合并深度优先搜索 广度优先搜索 并查集 4+🟠🀄️open in new window 🔗open in new window
547省份数量深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
130被围绕的区域[✓]深度优先搜索 广度优先搜索 并查集 2+🟠🀄️open in new window 🔗open in new window
1631最小体力消耗路径深度优先搜索 广度优先搜索 并查集 4+🟠🀄️open in new window 🔗open in new window
399除法求值[✓]深度优先搜索 广度优先搜索 并查集 4+🟠🀄️open in new window 🔗open in new window
1319连通网络的操作次数深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
684冗余连接深度优先搜索 广度优先搜索 并查集 1+🟠🀄️open in new window 🔗open in new window
128最长连续序列[✓]并查集 数组 哈希表🟠🀄️open in new window 🔗open in new window
765情侣牵手贪心 深度优先搜索 广度优先搜索 2+🔴🀄️open in new window 🔗open in new window

设计

题号标题题解标签难度力扣
1603设计停车系统设计 计数 模拟🟢🀄️open in new window 🔗open in new window
705设计哈希集合[✓]设计 数组 哈希表 2+🟢🀄️open in new window 🔗open in new window
706设计哈希映射[✓]设计 数组 哈希表 2+🟢🀄️open in new window 🔗open in new window
703数据流中的第 K 大元素[✓] 设计 二叉搜索树 3+🟢🀄️open in new window 🔗open in new window
146LRU 缓存[✓]设计 哈希表 链表 1+🟠🀄️open in new window 🔗open in new window
341扁平化嵌套列表迭代器 深度优先搜索 3+🟠🀄️open in new window 🔗open in new window
208实现 Trie (前缀树)[✓]设计 字典树 哈希表 1+🟠🀄️open in new window 🔗open in new window
173二叉搜索树迭代器[✓] 设计 3+🟠🀄️open in new window 🔗open in new window
622设计循环队列[✓]设计 队列 数组 1+🟠🀄️open in new window 🔗open in new window
380O(1) 时间插入、删除和获取随机元素[✓]设计 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
295数据流的中位数[✓]设计 双指针 数据流 2+🔴🀄️open in new window 🔗open in new window
460LFU 缓存设计 哈希表 链表 1+🔴🀄️open in new window 🔗open in new window

贪心

题号标题题解标签难度力扣
264丑数 II[✓]哈希表 数学 动态规划 1+🟠🀄️open in new window 🔗open in new window
946验证栈序列[✓] 数组 模拟🟠🀄️open in new window 🔗open in new window
767重构字符串贪心 哈希表 字符串 3+🟠🀄️open in new window 🔗open in new window
373查找和最小的 K 对数字[✓]数组 堆(优先队列)🟠🀄️open in new window 🔗open in new window
313超级丑数数组 数学 动态规划🟠🀄️open in new window 🔗open in new window

回溯

题号标题题解标签难度力扣
46全排列[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
22括号生成[✓]字符串 动态规划 回溯🟠🀄️open in new window 🔗open in new window
93复原 IP 地址[✓]字符串 回溯🟠🀄️open in new window 🔗open in new window
78子集[✓]位运算 数组 回溯🟠🀄️open in new window 🔗open in new window
17电话号码的字母组合[✓]哈希表 字符串 回溯🟠🀄️open in new window 🔗open in new window
79单词搜索[✓]数组 字符串 回溯 1+🟠🀄️open in new window 🔗open in new window
90子集 II[✓]位运算 数组 回溯🟠🀄️open in new window 🔗open in new window
39组合总和[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
77组合[✓]回溯🟠🀄️open in new window 🔗open in new window
40组合总和 II[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
47全排列 II[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
842将数组拆分成斐波那契序列字符串 回溯🟠🀄️open in new window 🔗open in new window
216组合总和 III[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
89格雷编码位运算 数学 回溯🟠🀄️open in new window 🔗open in new window
51N 皇后[✓]数组 回溯🔴🀄️open in new window 🔗open in new window
37解数独[✓]数组 哈希表 回溯 1+🔴🀄️open in new window 🔗open in new window
126单词接龙 II广度优先搜索 哈希表 字符串 1+🔴🀄️open in new window 🔗open in new window
1659最大化网格幸福感位运算 记忆化搜索 动态规划 1+🔴🀄️open in new window 🔗open in new window

克隆

题号标题题解标签难度力扣
133克隆图[✓]深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
138随机链表的复制[✓]哈希表 链表🟠🀄️open in new window 🔗open in new window

数学

题号标题题解标签难度力扣
204计数质数数组 数学 枚举 1+🟠🀄️open in new window 🔗open in new window
628三个数的最大乘积数组 数学 排序🟢🀄️open in new window 🔗open in new window
976三角形的最大周长贪心 数组 数学 1+🟢🀄️open in new window 🔗open in new window
202快乐数[✓]哈希表 数学 双指针🟢🀄️open in new window 🔗open in new window
1232缀点成线几何 数组 数学🟢🀄️open in new window 🔗open in new window
29两数相除[✓]位运算 数学🟠🀄️open in new window 🔗open in new window
343整数拆分[✓]数学 动态规划🟠🀄️open in new window 🔗open in new window
166分数到小数哈希表 数学 字符串🟠🀄️open in new window 🔗open in new window
149直线上最多的点数[✓]几何 数组 哈希表 1+🔴🀄️open in new window 🔗open in new window

极大极小化

题号标题题解标签难度力扣
292Nim 游戏脑筋急转弯 数学 博弈🟢🀄️open in new window 🔗open in new window
375猜数字大小 II[✓]数学 动态规划 博弈🟠🀄️open in new window 🔗open in new window
486预测赢家递归 数组 数学 2+🟠🀄️open in new window 🔗open in new window
464我能赢吗位运算 记忆化搜索 数学 3+🟠🀄️open in new window 🔗open in new window
877石子游戏数组 数学 动态规划 1+🟠🀄️open in new window 🔗open in new window

几何

题号标题题解标签难度力扣
1232缀点成线几何 数组 数学🟢🀄️open in new window 🔗open in new window
1266访问所有点的最小时间几何 数组 数学🟢🀄️open in new window 🔗open in new window
892三维形体的表面积几何 数组 数学 1+🟢🀄️open in new window 🔗open in new window
1401圆和矩形是否有重叠几何 数学🟠🀄️open in new window 🔗open in new window
963最小面积矩形 II几何 数组 数学🟠🀄️open in new window 🔗open in new window
587安装栅栏几何 数组 数学🔴🀄️open in new window 🔗open in new window
1515服务中心的最佳位置几何 数组 数学 1+🔴🀄️open in new window 🔗open in new window

相关信息

数据来源: Leetcode-retagopen in new window