跳至主要內容

回溯


回溯

全部标签

数据结构

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

算法

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

其他

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


题号标题题解标签难度力扣
17电话号码的字母组合[✓]哈希表 字符串 回溯🟠🀄️open in new window 🔗open in new window
22括号生成[✓]字符串 动态规划 回溯🟠🀄️open in new window 🔗open in new window
37解数独[✓]数组 哈希表 回溯 1+🔴🀄️open in new window 🔗open in new window
39组合总和[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
40组合总和 II[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
46全排列[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
47全排列 II[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
51N 皇后[✓]数组 回溯🔴🀄️open in new window 🔗open in new window
52N 皇后 II[✓]回溯🔴🀄️open in new window 🔗open in new window
77组合[✓]回溯🟠🀄️open in new window 🔗open in new window
78子集[✓]位运算 数组 回溯🟠🀄️open in new window 🔗open in new window
79单词搜索[✓]数组 字符串 回溯 1+🟠🀄️open in new window 🔗open in new window
89格雷编码位运算 数学 回溯🟠🀄️open in new window 🔗open in new window
90子集 II[✓]位运算 数组 回溯🟠🀄️open in new window 🔗open in new window
93复原 IP 地址[✓]字符串 回溯🟠🀄️open in new window 🔗open in new window
95不同的二叉搜索树 II[✓] 二叉搜索树 动态规划 2+🟠🀄️open in new window 🔗open in new window
113路径总和 II[✓] 深度优先搜索 回溯 1+🟠🀄️open in new window 🔗open in new window
126单词接龙 II广度优先搜索 哈希表 字符串 1+🔴🀄️open in new window 🔗open in new window
131分割回文串[✓]字符串 动态规划 回溯🟠🀄️open in new window 🔗open in new window
140单词拆分 II字典树 记忆化搜索 数组 4+🔴🀄️open in new window 🔗open in new window
212单词搜索 II[✓]字典树 数组 字符串 2+🔴🀄️open in new window 🔗open in new window
216组合总和 III[✓]数组 回溯🟠🀄️open in new window 🔗open in new window
254因子的组合 🔒回溯🟠🀄️open in new window 🔗open in new window
257二叉树的所有路径[✓] 深度优先搜索 字符串 2+🟢🀄️open in new window 🔗open in new window
267回文排列 II 🔒哈希表 字符串 回溯🟠🀄️open in new window 🔗open in new window
282给表达式添加运算符数学 字符串 回溯🔴🀄️open in new window 🔗open in new window
291单词规律 II 🔒哈希表 字符串 回溯🟠🀄️open in new window 🔗open in new window
294翻转游戏 II 🔒记忆化搜索 数学 动态规划 2+🟠🀄️open in new window 🔗open in new window
301删除无效的括号广度优先搜索 字符串 回溯🔴🀄️open in new window 🔗open in new window
306累加数字符串 回溯🟠🀄️open in new window 🔗open in new window
320列举单词的全部缩写 🔒位运算 字符串 回溯🟠🀄️open in new window 🔗open in new window
351安卓系统手势解锁 🔒位运算 动态规划 回溯 1+🟠🀄️open in new window 🔗open in new window
357统计各位数字都不同的数字个数数学 动态规划 回溯🟠🀄️open in new window 🔗open in new window
401二进制手表位运算 回溯🟢🀄️open in new window 🔗open in new window
411最短独占单词缩写 🔒位运算 数组 字符串 1+🔴🀄️open in new window 🔗open in new window
425单词方块 🔒字典树 数组 字符串 1+🔴🀄️open in new window 🔗open in new window
465最优账单平衡 🔒位运算 数组 动态规划 2+🔴🀄️open in new window 🔗open in new window
473火柴拼正方形位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
489扫地机器人 🔒回溯 交互🔴🀄️open in new window 🔗open in new window
491非递减子序列位运算 数组 哈希表 1+🟠🀄️open in new window 🔗open in new window
494目标和[✓]数组 动态规划 回溯🟠🀄️open in new window 🔗open in new window
526优美的排列位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
638大礼包位运算 记忆化搜索 数组 3+🟠🀄️open in new window 🔗open in new window
67924 点游戏数组 数学 回溯🔴🀄️open in new window 🔗open in new window
681最近时刻 🔒哈希表 字符串 回溯 1+🟠🀄️open in new window 🔗open in new window
691贴纸拼词位运算 数组 字符串 3+🔴🀄️open in new window 🔗open in new window
698划分为k个相等的子集位运算 记忆化搜索 数组 3+🟠🀄️open in new window 🔗open in new window
784字母大小写全排列位运算 字符串 回溯🟠🀄️open in new window 🔗open in new window
797所有可能的路径深度优先搜索 广度优先搜索 1+🟠🀄️open in new window 🔗open in new window
816模糊坐标字符串 回溯 枚举🟠🀄️open in new window 🔗open in new window
842将数组拆分成斐波那契序列字符串 回溯🟠🀄️open in new window 🔗open in new window
967连续差相同的数字广度优先搜索 回溯🟠🀄️open in new window 🔗open in new window
980不同路径 III位运算 数组 回溯 1+🔴🀄️open in new window 🔗open in new window
988从叶结点开始的最小字符串 深度优先搜索 字符串 2+🟠🀄️open in new window 🔗open in new window
996平方数组的数目位运算 数组 哈希表 4+🔴🀄️open in new window 🔗open in new window
1066校园自行车分配 II 🔒位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
1079活字印刷哈希表 字符串 回溯 1+🟠🀄️open in new window 🔗open in new window
1087花括号展开 🔒广度优先搜索 字符串 回溯🟠🀄️open in new window 🔗open in new window
1088易混淆数 II 🔒数学 回溯🔴🀄️open in new window 🔗open in new window
1096花括号展开 II 广度优先搜索 字符串 1+🔴🀄️open in new window 🔗open in new window
1215步进数 🔒广度优先搜索 数学 回溯🟠🀄️open in new window 🔗open in new window
1219黄金矿工数组 回溯 矩阵🟠🀄️open in new window 🔗open in new window
1238循环码排列位运算 数学 回溯🟠🀄️open in new window 🔗open in new window
1239串联字符串的最大长度位运算 数组 字符串 1+🟠🀄️open in new window 🔗open in new window
1240铺瓷砖回溯🔴🀄️open in new window 🔗open in new window
1255得分最高的单词集合位运算 数组 字符串 3+🔴🀄️open in new window 🔗open in new window
1258近义词句子 🔒并查集 数组 哈希表 2+🟠🀄️open in new window 🔗open in new window
1286字母组合迭代器设计 字符串 回溯 1+🟠🀄️open in new window 🔗open in new window
1307口算难题数组 数学 字符串 1+🔴🀄️open in new window 🔗open in new window
1415长度为 n 的开心字符串中字典序第 k 小的字符串字符串 回溯🟠🀄️open in new window 🔗open in new window
1467两个盒子中球的颜色数相同的概率数组 数学 动态规划 3+🔴🀄️open in new window 🔗open in new window
1593拆分字符串使唯一子字符串的数目最大[✓]哈希表 字符串 回溯🟠🀄️open in new window 🔗open in new window
1601最多可达成的换楼请求数目位运算 数组 回溯 1+🔴🀄️open in new window 🔗open in new window
1655分配重复整数位运算 数组 动态规划 2+🔴🀄️open in new window 🔗open in new window
1718构建字典序最大的可行序列数组 回溯🟠🀄️open in new window 🔗open in new window
1723完成所有工作的最短时间位运算 数组 动态规划 2+🔴🀄️open in new window 🔗open in new window
1774最接近目标价格的甜点成本数组 动态规划 回溯🟠🀄️open in new window 🔗open in new window
1799N 次操作后的最大分数和位运算 数组 数学 4+🔴🀄️open in new window 🔗open in new window
1849将字符串拆分为递减的连续值字符串 回溯🟠🀄️open in new window 🔗open in new window
1863找出所有子集的异或总和再求和位运算 数组 数学 3+🟢🀄️open in new window 🔗open in new window
1947最大兼容性评分和位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
1980找出不同的二进制字符串数组 哈希表 字符串 1+🟠🀄️open in new window 🔗open in new window
1986完成任务的最少工作时间段位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
2002两个回文子序列长度的最大乘积位运算 字符串 动态规划 2+🟠🀄️open in new window 🔗open in new window
2014重复 K 次的最长子序列贪心 字符串 回溯 2+🔴🀄️open in new window 🔗open in new window
2044统计按位或能得到最大值的子集数目[✓]位运算 数组 回溯 1+🟠🀄️open in new window 🔗open in new window
2048下一个更大的数值平衡数数学 回溯 枚举🟠🀄️open in new window 🔗open in new window
2056棋盘上有效移动组合的数目数组 字符串 回溯 1+🔴🀄️open in new window 🔗open in new window
2065最大化一张图中的路径价值 数组 回溯🔴🀄️open in new window 🔗open in new window
2151基于陈述统计最多好人数位运算 数组 回溯 1+🔴🀄️open in new window 🔗open in new window
2152穿过所有点的所需最少直线数量 🔒位运算 几何 数组 5+🟠🀄️open in new window 🔗open in new window
2178拆分成最多数目的正偶数之和贪心 数学 回溯🟠🀄️open in new window 🔗open in new window
2212射箭比赛中的最大得分位运算 数组 回溯 1+🟠🀄️open in new window 🔗open in new window
2305公平分发饼干位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
2375根据模式串构造最小数字 贪心 字符串 1+🟠🀄️open in new window 🔗open in new window
2397被列覆盖的最多行数位运算 数组 回溯 2+🟠🀄️open in new window 🔗open in new window
2597美丽子集的数目数组 哈希表 数学 4+🟠🀄️open in new window 🔗open in new window
2664巡逻的骑士 🔒数组 回溯 矩阵🟠🀄️open in new window 🔗open in new window
2698求一个整数的惩罚数数学 回溯🟠🀄️open in new window 🔗open in new window
2708一个小组的最大实力值贪心 位运算 数组 4+🟠🀄️open in new window 🔗open in new window
2767将字符串分割为最少的美丽子字符串哈希表 字符串 动态规划 1+🟠🀄️open in new window 🔗open in new window
2992自整除排列的数量 🔒位运算 数组 动态规划 2+🟠🀄️open in new window 🔗open in new window
LCP 51烹饪料理位运算 数组 回溯 1+🟢🀄️open in new window
LCP 58积木拼接数组 回溯 矩阵🔴🀄️open in new window
剑指 Offer 12矩阵中的路径[✓]数组 字符串 回溯 1+🟠🀄️open in new window
剑指 Offer 34二叉树中和为某一值的路径[✓] 深度优先搜索 回溯 1+🟠🀄️open in new window
剑指 Offer 38字符串的排列[✓]字符串 回溯🟠🀄️open in new window
剑指 Offer II 102加减的目标值[✓]数组 动态规划 回溯🟠🀄️open in new window
剑指 Offer II 110所有路径深度优先搜索 广度优先搜索 1+🟠🀄️open in new window
剑指 Offer II 79所有子集[✓]位运算 数组 回溯🟠🀄️open in new window
剑指 Offer II 80含有 k 个元素的组合[✓]数组 回溯🟠🀄️open in new window
剑指 Offer II 81允许重复选择元素的组合[✓]数组 回溯🟠🀄️open in new window
剑指 Offer II 82含有重复元素集合的组合[✓]数组 回溯🟠🀄️open in new window
剑指 Offer II 83没有重复元素集合的全排列[✓]数组 回溯🟠🀄️open in new window
剑指 Offer II 84含有重复元素集合的全排列[✓]数组 回溯🟠🀄️open in new window
剑指 Offer II 85生成匹配的括号[✓]字符串 动态规划 回溯🟠🀄️open in new window
剑指 Offer II 87复原 IP[✓]字符串 回溯🟠🀄️open in new window
面试题 04.09二叉搜索树序列 二叉搜索树 回溯 1+🔴🀄️open in new window
面试题 08.02迷路的机器人数组 动态规划 回溯 1+🟠🀄️open in new window
面试题 08.04幂集位运算 数组 回溯🟠🀄️open in new window
面试题 08.07无重复字符串的排列组合字符串 回溯🟠🀄️open in new window
面试题 08.08有重复字符串的排列组合字符串 回溯🟠🀄️open in new window
面试题 08.09括号字符串 动态规划 回溯🟠🀄️open in new window
面试题 08.12八皇后数组 回溯🔴🀄️open in new window
面试题 16.18模式匹配数学 字符串 回溯 1+🟠🀄️open in new window
面试题 17.22单词转换广度优先搜索 哈希表 字符串 1+🟠🀄️open in new window
面试题 17.25单词矩阵字典树 数组 字符串 1+🔴🀄️open in new window