跳至主要內容


全部标签

数据结构

数组 矩阵 链表 双向链表 单调栈 队列 单调队列 堆(优先队列) 哈希表 字符串 字符串匹配 二叉树 二叉搜索树 最小生成树 有序集合 拓扑排序 最短路 强连通分量 欧拉回路 双连通分量 并查集 字典树 线段树 树状数组 后缀数组

算法

枚举 递归 分治 回溯 贪心 动态规划 排序 桶排序 计数排序 基数排序 归并排序 快速选择 二分查找 记忆化搜索 深度优先搜索 广度优先搜索 双指针 位运算 前缀和 计数 滑动窗口 状态压缩 哈希函数 滚动哈希 扫描线

其他

数学 数论 几何 博弈 模拟 组合数学 随机化 概率与统计 水塘抽样 拒绝采样 数据库 设计 数据流 脑筋急转弯 交互 迭代器 多线程


题号标题题解标签难度力扣
20有效的括号[✓] 字符串🟢🀄️open in new window 🔗open in new window
32最长有效括号[✓] 字符串 动态规划🔴🀄️open in new window 🔗open in new window
42接雨水[✓] 数组 双指针 2+🔴🀄️open in new window 🔗open in new window
71简化路径[✓] 字符串🟠🀄️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
94二叉树的中序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
114二叉树展开为链表[✓] 深度优先搜索 2+🟠🀄️open in new window 🔗open in new window
143重排链表[✓] 递归 链表 1+🟠🀄️open in new window 🔗open in new window
144二叉树的前序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
145二叉树的后序遍历[✓] 深度优先搜索 1+🟢🀄️open in new window 🔗open in new window
150逆波兰表达式求值[✓] 数组 数学🟠🀄️open in new window 🔗open in new window
155最小栈[✓] 设计🟠🀄️open in new window 🔗open in new window
173二叉搜索树迭代器[✓] 设计 3+🟠🀄️open in new window 🔗open in new window
224基本计算器[✓] 递归 数学 1+🔴🀄️open in new window 🔗open in new window
225用队列实现栈[✓] 设计 队列🟢🀄️open in new window 🔗open in new window
227基本计算器 II[✓] 数学 字符串🟠🀄️open in new window 🔗open in new window
232用栈实现队列[✓] 设计 队列🟢🀄️open in new window 🔗open in new window
234回文链表[✓] 递归 链表 1+🟢🀄️open in new window 🔗open in new window
255验证二叉搜索树的前序遍历序列 🔒 二叉搜索树 4+🟠🀄️open in new window 🔗open in new window
272最接近的二叉搜索树值 II 🔒 深度优先搜索 4+🔴🀄️open in new window 🔗open in new window
316去除重复字母[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
321拼接最大数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
331验证二叉树的前序序列化 字符串 1+🟠🀄️open in new window 🔗open in new window
341扁平化嵌套列表迭代器 深度优先搜索 3+🟠🀄️open in new window 🔗open in new window
364嵌套列表加权和 II 🔒 深度优先搜索 广度优先搜索🟠🀄️open in new window 🔗open in new window
385迷你语法分析器 深度优先搜索 字符串🟠🀄️open in new window 🔗open in new window
388文件的最长绝对路径 深度优先搜索 字符串🟠🀄️open in new window 🔗open in new window
394字符串解码[✓] 递归 字符串🟠🀄️open in new window 🔗open in new window
402移掉 K 位数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
426将二叉搜索树转化为排序的双向链表 🔒[✓] 深度优先搜索 4+🟠🀄️open in new window 🔗open in new window
439三元表达式解析器 🔒 递归 字符串🟠🀄️open in new window 🔗open in new window
445两数相加 II[✓] 链表 数学🟠🀄️open in new window 🔗open in new window
456132 模式 数组 二分查找 2+🟠🀄️open in new window 🔗open in new window
484寻找排列 🔒 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
488祖玛游戏 广度优先搜索 记忆化搜索 2+🔴🀄️open in new window 🔗open in new window
496下一个更大元素 I[✓] 数组 哈希表 1+🟢🀄️open in new window 🔗open in new window
503下一个更大元素 II[✓] 数组 单调栈🟠🀄️open in new window 🔗open in new window
536从字符串生成二叉树 🔒 深度优先搜索 2+🟠🀄️open in new window 🔗open in new window
581最短无序连续子数组 贪心 数组 3+🟠🀄️open in new window 🔗open in new window
589N 叉树的前序遍历[✓] 深度优先搜索🟢🀄️open in new window 🔗open in new window
590N 叉树的后序遍历[✓] 深度优先搜索🟢🀄️open in new window 🔗open in new window
591标签验证器 字符串🔴🀄️open in new window 🔗open in new window
636函数的独占时间 数组🟠🀄️open in new window 🔗open in new window
654最大二叉树[✓] 数组 3+🟠🀄️open in new window 🔗open in new window
678有效的括号字符串[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
682棒球比赛[✓] 数组 模拟🟢🀄️open in new window 🔗open in new window
716最大栈 🔒 设计 链表 2+🔴🀄️open in new window 🔗open in new window
726原子的数量 哈希表 字符串 1+🔴🀄️open in new window 🔗open in new window
735小行星碰撞[✓] 数组 模拟🟠🀄️open in new window 🔗open in new window
736Lisp 语法解析 递归 哈希表 1+🔴🀄️open in new window 🔗open in new window
739每日温度[✓] 数组 单调栈🟠🀄️open in new window 🔗open in new window
768最多能完成排序的块 II 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
769最多能完成排序的块 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
770基本计算器 IV 递归 哈希表 2+🔴🀄️open in new window 🔗open in new window
772基本计算器 III 🔒[✓] 递归 数学 1+🔴🀄️open in new window 🔗open in new window
844比较含退格的字符串[✓] 双指针 字符串 1+🟢🀄️open in new window 🔗open in new window
853车队 数组 排序 1+🟠🀄️open in new window 🔗open in new window
856括号的分数 字符串🟠🀄️open in new window 🔗open in new window
880索引处的解码字符串[✓] 字符串🟠🀄️open in new window 🔗open in new window
895最大频率栈 设计 哈希表 1+🔴🀄️open in new window 🔗open in new window
897递增顺序搜索树 深度优先搜索 2+🟢🀄️open in new window 🔗open in new window
901股票价格跨度[✓] 设计 数据流 1+🟠🀄️open in new window 🔗open in new window
907子数组的最小值之和 数组 动态规划 1+🟠🀄️open in new window 🔗open in new window
921使括号有效的最少添加[✓] 贪心 字符串🟠🀄️open in new window 🔗open in new window
936戳印序列 贪心 队列 1+🔴🀄️open in new window 🔗open in new window
946验证栈序列[✓] 数组 模拟🟠🀄️open in new window 🔗open in new window
962最大宽度坡[✓] 数组 单调栈🟠🀄️open in new window 🔗open in new window
975奇偶跳 数组 动态规划 2+🔴🀄️open in new window 🔗open in new window
1003检查替换后的词是否有效 字符串🟠🀄️open in new window 🔗open in new window
1006笨阶乘 数学 模拟🟠🀄️open in new window 🔗open in new window
1008前序遍历构造二叉搜索树[✓] 二叉搜索树 3+🟠🀄️open in new window 🔗open in new window
1019链表中的下一个更大节点 数组 链表 1+🟠🀄️open in new window 🔗open in new window
1021删除最外层的括号[✓] 字符串🟢🀄️open in new window 🔗open in new window
1047删除字符串中的所有相邻重复项[✓] 字符串🟢🀄️open in new window 🔗open in new window
1063有效子数组的数目 🔒 数组 单调栈🔴🀄️open in new window 🔗open in new window
1081不同字符的最小子序列[✓] 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
1096花括号展开 II 广度优先搜索 字符串 1+🔴🀄️open in new window 🔗open in new window
1106解析布尔表达式[✓] 递归 字符串🔴🀄️open in new window 🔗open in new window
1111有效括号的嵌套深度 字符串🟠🀄️open in new window 🔗open in new window
1124表现良好的最长时间段 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1130叶值的最小代价生成树 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
1172餐盘栈 设计 哈希表 1+🔴🀄️open in new window 🔗open in new window
1190反转每对括号间的子串[✓] 字符串🟠🀄️open in new window 🔗open in new window
1209删除字符串中的所有相邻重复项 II 字符串🟠🀄️open in new window 🔗open in new window
1214查找两棵二叉搜索树之和 🔒 深度优先搜索 4+🟠🀄️open in new window 🔗open in new window
1249移除无效的括号 字符串🟠🀄️open in new window 🔗open in new window
1265逆序打印不可变链表 🔒 递归 链表 1+🟠🀄️open in new window 🔗open in new window
1381设计一个支持增量操作的栈[✓] 设计 数组🟠🀄️open in new window 🔗open in new window
1441用栈操作构建数组[✓] 数组 模拟🟠🀄️open in new window 🔗open in new window
1472设计浏览器历史记录[✓] 设计 数组 3+🟠🀄️open in new window 🔗open in new window
1475商品折扣后的最终价格[✓] 数组 单调栈🟢🀄️open in new window 🔗open in new window
1504统计全 1 子矩形 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
1526形成目标数组的子数组最少增加次数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
1541平衡括号字符串的最少插入次数 贪心 字符串🟠🀄️open in new window 🔗open in new window
1544整理字符串 字符串🟢🀄️open in new window 🔗open in new window
1574删除最短的子数组使剩余数组有序[✓] 数组 双指针 2+🟠🀄️open in new window 🔗open in new window
1586二叉搜索树迭代器 II 🔒 设计 3+🟠🀄️open in new window 🔗open in new window
1597根据中缀表达式构造二叉表达式树 🔒 字符串 1+🔴🀄️open in new window 🔗open in new window
1598文件夹操作日志搜集器 数组 字符串🟢🀄️open in new window 🔗open in new window
1614括号的最大嵌套深度 字符串🟢🀄️open in new window 🔗open in new window
1628设计带解析函数的表达式树 🔒 设计 3+🟠🀄️open in new window 🔗open in new window
1653使字符串平衡的最少删除次数 字符串 动态规划🟠🀄️open in new window 🔗open in new window
1673找出最具竞争力的子序列 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
1700无法吃午餐的学生数量 队列 数组 1+🟢🀄️open in new window 🔗open in new window
1717删除子字符串的最大得分 贪心 字符串🟠🀄️open in new window 🔗open in new window
1756设计最近使用(MRU)队列 🔒 设计 树状数组 3+🟠🀄️open in new window 🔗open in new window
1762能看到海景的建筑物 🔒 数组 单调栈🟠🀄️open in new window 🔗open in new window
1776车队 II 数组 数学 2+🔴🀄️open in new window 🔗open in new window
1793好子数组的最大分数 数组 双指针 2+🔴🀄️open in new window 🔗open in new window
1856子数组最小乘积的最大值 数组 前缀和 1+🟠🀄️open in new window 🔗open in new window
1896反转表达式值的最少操作次数 数学 字符串 1+🔴🀄️open in new window 🔗open in new window
1910删除一个字符串中所有出现的给定子字符串 字符串 模拟🟠🀄️open in new window 🔗open in new window
1944队列中可以看到的人数 数组 单调栈🔴🀄️open in new window 🔗open in new window
1950所有子数组最小值中的最大值 🔒 数组 单调栈🟠🀄️open in new window 🔗open in new window
1963使字符串平衡的最小交换次数[✓] 贪心 双指针 1+🟠🀄️open in new window 🔗open in new window
1996游戏中弱角色的数量 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
2000反转单词前缀 双指针 字符串🟢🀄️open in new window 🔗open in new window
2019解出数学表达式的学生分数 记忆化搜索 数组 3+🔴🀄️open in new window 🔗open in new window
2030含特定字母的最小子序列 贪心 字符串 1+🔴🀄️open in new window 🔗open in new window
2104子数组范围和 数组 单调栈🟠🀄️open in new window 🔗open in new window
2116判断一个括号字符串是否有效 贪心 字符串🟠🀄️open in new window 🔗open in new window
2130链表最大孪生和[✓] 链表 双指针🟠🀄️open in new window 🔗open in new window
2197替换数组中的非互质数 数组 数学 1+🔴🀄️open in new window 🔗open in new window
2211统计道路上的碰撞次数 字符串 模拟🟠🀄️open in new window 🔗open in new window
2216美化数组的最少删除数 贪心 数组🟠🀄️open in new window 🔗open in new window
2254设计视频共享平台 🔒 设计 哈希表 1+🔴🀄️open in new window 🔗open in new window
2281巫师的总力量和 数组 前缀和 1+🔴🀄️open in new window 🔗open in new window
2282在一个网格中可以看到的人数 🔒 数组 矩阵 1+🟠🀄️open in new window 🔗open in new window
2289使数组按非递减顺序排列 数组 链表 1+🟠🀄️open in new window 🔗open in new window
2296设计一个文本编辑器 设计 链表 3+🔴🀄️open in new window 🔗open in new window
2297跳跃游戏 VIII 🔒 数组 3+🟠🀄️open in new window 🔗open in new window
2334元素值大于变化阈值的子数组 并查集 数组 1+🔴🀄️open in new window 🔗open in new window
2345寻找可见山的数量 🔒 数组 排序 1+🟠🀄️open in new window 🔗open in new window
2355你能拿走的最大图书数量 🔒 数组 动态规划 1+🔴🀄️open in new window 🔗open in new window
2375根据模式串构造最小数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
2390从字符串中移除星号[✓] 字符串 模拟🟠🀄️open in new window 🔗open in new window
2434使用机器人打印字典序最小的字符串 贪心 哈希表 1+🟠🀄️open in new window 🔗open in new window
2454下一个更大元素 IV 数组 二分查找 3+🔴🀄️open in new window 🔗open in new window
2487从链表中移除节点 递归 链表 1+🟠🀄️open in new window 🔗open in new window
2589完成所有任务的最少时间 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
2617网格图中最少访问的格子数 广度优先搜索 并查集 5+🔴🀄️open in new window 🔗open in new window
2645构造有效字符串的最少插入数 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
2696删除子串后的字符串最小长度[✓] 字符串 模拟🟢🀄️open in new window 🔗open in new window
2736最大和查询 树状数组 线段树 4+🔴🀄️open in new window 🔗open in new window
2751机器人碰撞 数组 排序 1+🔴🀄️open in new window 🔗open in new window
2764数组是否表示某二叉树的前序遍历 🔒 深度优先搜索 1+🟠🀄️open in new window 🔗open in new window
2813子序列最大优雅度 贪心 数组 3+🔴🀄️open in new window 🔗open in new window
2816翻倍以链表形式表示的数字 链表 数学🟠🀄️open in new window 🔗open in new window
2818操作使得分最大 贪心 数组 3+🔴🀄️open in new window 🔗open in new window
2832每个元素为最大值的最大范围 🔒 数组 单调栈🟠🀄️open in new window 🔗open in new window
2863最长半递减子数组的长度 🔒 数组 排序 1+🟠🀄️open in new window 🔗open in new window
2865美丽塔 I 数组 单调栈🟠🀄️open in new window 🔗open in new window
2866美丽塔 II 数组 单调栈🟠🀄️open in new window 🔗open in new window
2940找到 Alice 和 Bob 可以相遇的建筑 树状数组 线段树 4+🔴🀄️open in new window 🔗open in new window
2945找到最大非递减数组的长度 队列 数组 4+🔴🀄️open in new window 🔗open in new window
3113边界元素是最大值的子数组数目 数组 二分查找 1+🔴🀄️open in new window 🔗open in new window
3170删除星号以后字典序最小的字符串 贪心 哈希表 2+🟠🀄️open in new window 🔗open in new window
3174清除数字 字符串 模拟🟢🀄️open in new window 🔗open in new window
3205最大数组跳跃得分 I 🔒 贪心 数组 2+🟠🀄️open in new window 🔗open in new window
3221最大数组跳跃得分 II 🔒 贪心 数组 1+🟠🀄️open in new window 🔗open in new window
3229使数组等于目标数组所需的最少操作次数 贪心 数组 2+🔴🀄️open in new window 🔗open in new window
剑指 Offer 30包含min函数的栈[✓] 设计🟢🀄️open in new window
剑指 Offer 31栈的压入、弹出序列[✓] 数组 模拟🟠🀄️open in new window
剑指 Offer 33二叉搜索树的后序遍历序列[✓] 二叉搜索树 4+🟠🀄️open in new window
剑指 Offer 36二叉搜索树与双向链表[✓] 深度优先搜索 4+🟠🀄️open in new window
剑指 Offer 6从尾到头打印链表[✓] 递归 链表 1+🟢🀄️open in new window
剑指 Offer 9用两个栈实现队列[✓] 设计 队列🟢🀄️open in new window
剑指 Offer II 25链表中的两数相加[✓] 链表 数学🟠🀄️open in new window
剑指 Offer II 26重排链表[✓] 递归 链表 1+🟠🀄️open in new window
剑指 Offer II 27回文链表[✓] 递归 链表 1+🟢🀄️open in new window
剑指 Offer II 36后缀表达式[✓] 数组 数学🟠🀄️open in new window
剑指 Offer II 37小行星碰撞 数组 模拟🟠🀄️open in new window
剑指 Offer II 38每日温度[✓] 数组 单调栈🟠🀄️open in new window
剑指 Offer II 39直方图最大矩形面积[✓] 数组 单调栈🔴🀄️open in new window
剑指 Offer II 40矩阵中最大的矩形[✓] 数组 动态规划 2+🔴🀄️open in new window
剑指 Offer II 52展平二叉搜索树 深度优先搜索 2+🟢🀄️open in new window
剑指 Offer II 55二叉搜索树迭代器[✓] 设计 3+🟠🀄️open in new window
面试题 02.06回文链表 递归 链表 1+🟢🀄️open in new window
面试题 03.01三合一 设计 数组🟢🀄️open in new window
面试题 03.02栈的最小值 设计🟢🀄️open in new window
面试题 03.03堆盘子 设计 链表🟠🀄️open in new window
面试题 03.04化栈为队 设计 队列🟢🀄️open in new window
面试题 03.05栈排序 设计 单调栈🟠🀄️open in new window
面试题 16.16部分排序 贪心 数组 3+🟠🀄️open in new window
面试题 16.26计算器 数学 字符串🟠🀄️open in new window
面试题 17.12BiNode 深度优先搜索 3+🟢🀄️open in new window
面试题 17.21直方图的水量 数组 双指针 2+🔴🀄️open in new window