# Leetcode **Repository Path**: zhiyin12138/Leetcode ## Basic Information - **Project Name**: Leetcode - **Description**: Leetcode 题目练习记录,Java语言 - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2020-09-12 - **Last Updated**: 2023-03-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README [TOC] ### (Tree)树 > 联想词:二叉搜索树、递归、迭代(模拟递归) [94. 二叉树的中序遍历](https://leetcode-cn.com/problems/binary-tree-inorder-traversal/) [99. 恢复二叉搜索树](https://leetcode-cn.com/problems/recover-binary-search-tree/) [105. 从前序与中序遍历序列构造二叉树](https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)(与 剑指 Offer 07 同) [106. 从中序与后序遍历序列构造二叉树](https://leetcode-cn.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/) [108. 将有序数组转换为二叉搜索树](https://leetcode-cn.com/problems/convert-sorted-array-to-binary-search-tree/) [109. 有序链表转换二叉搜索树](https://leetcode-cn.com/problems/convert-sorted-list-to-binary-search-tree/) [113. 路径总和 II](https://leetcode-cn.com/problems/path-sum-ii/) [116. 填充每个节点的下一个右侧节点指针](https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node/)(与 117 相似) [117. 填充每个节点的下一个右侧节点指针 II](https://leetcode-cn.com/problems/populating-next-right-pointers-in-each-node-ii/)(与 116 相似) [129. 求根到叶子节点数字之和](https://leetcode-cn.com/problems/sum-root-to-leaf-numbers/) [144. 二叉树的前序遍历](https://leetcode-cn.com/problems/binary-tree-preorder-traversal/) [145. 二叉树的后序遍历](https://leetcode-cn.com/problems/binary-tree-postorder-traversal/) [173. 二叉搜索树迭代器](https://leetcode-cn.com/problems/binary-search-tree-iterator/) [199. 二叉树的右视图](https://leetcode-cn.com/problems/binary-tree-right-side-view/) [226. 翻转二叉树](https://leetcode-cn.com/problems/invert-binary-tree/) [235. 二叉搜索树的最近公共祖先](https://leetcode-cn.com/problems/lowest-common-ancestor-of-a-binary-search-tree/) [297. 二叉树的序列化与反序列化](https://leetcode-cn.com/problems/serialize-and-deserialize-binary-tree/) [307. 区域和检索 - 数组可修改](https://leetcode-cn.com/problems/range-sum-query-mutable/) [331. 验证二叉树的前序序列化](https://leetcode-cn.com/problems/verify-preorder-serialization-of-a-binary-tree/) [404. 左叶子之和](https://leetcode-cn.com/problems/sum-of-left-leaves/) [450. 删除二叉搜索树中的节点](https://leetcode-cn.com/problems/delete-node-in-a-bst/) [449. 序列化和反序列化二叉搜索树](https://leetcode-cn.com/problems/serialize-and-deserialize-bst/) [501. 二叉搜索树中的众数](https://leetcode-cn.com/problems/find-mode-in-binary-search-tree/) [530. 二叉搜索树的最小绝对差](https://leetcode-cn.com/problems/minimum-absolute-difference-in-bst/)(与 783 同) [538. 把二叉搜索树转换为累加树](https://leetcode-cn.com/problems/convert-bst-to-greater-tree/)(与 1038 同) [617. 合并二叉树](https://leetcode-cn.com/problems/merge-two-binary-trees/) [637. 二叉树的层平均值](https://leetcode-cn.com/problems/average-of-levels-in-binary-tree/) [671. 二叉树中第二小的节点](https://leetcode-cn.com/problems/second-minimum-node-in-a-binary-tree/) [700. 二叉搜索树中的搜索](https://leetcode-cn.com/problems/search-in-a-binary-search-tree/) [701. 二叉搜索树中的插入操作](https://leetcode-cn.com/problems/insert-into-a-binary-search-tree/) [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/)(与 530 同) [863. 二叉树中所有距离为 K 的结点](https://leetcode-cn.com/problems/all-nodes-distance-k-in-binary-tree/) [865. 具有所有最深节点的最小子树](https://leetcode-cn.com/problems/smallest-subtree-with-all-the-deepest-nodes/)(与 1123 同) [889. 根据前序和后序遍历构造二叉树](https://leetcode-cn.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/) [919. 完全二叉树插入器](https://leetcode-cn.com/problems/complete-binary-tree-inserter/) [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) [951. 翻转等价二叉树](https://leetcode-cn.com/problems/flip-equivalent-binary-trees/) [971. 翻转二叉树以匹配先序遍历](https://leetcode-cn.com/problems/flip-binary-tree-to-match-preorder-traversal/) [979. 在二叉树中分配硬币](https://leetcode-cn.com/problems/distribute-coins-in-binary-tree/) [987. 二叉树的垂序遍历](https://leetcode-cn.com/problems/vertical-order-traversal-of-a-binary-tree/) [998. 最大二叉树 II](https://leetcode-cn.com/problems/maximum-binary-tree-ii/) [1026. 节点与其祖先之间的最大差值](https://leetcode-cn.com/problems/maximum-difference-between-node-and-ancestor/) [1028. 从先序遍历还原二叉树](https://leetcode-cn.com/problems/recover-a-tree-from-preorder-traversal/) [1038. 从二叉搜索树到更大和树](https://leetcode-cn.com/problems/binary-search-tree-to-greater-sum-tree/)(与 538 同) [1123. 最深叶节点的最近公共祖先](https://leetcode-cn.com/problems/lowest-common-ancestor-of-deepest-leaves/)(与 865 同) [1145. 二叉树着色游戏](https://leetcode-cn.com/problems/binary-tree-coloring-game/) [1261. 在受污染的二叉树中查找元素](https://leetcode-cn.com/problems/find-elements-in-a-contaminated-binary-tree/) [1305. 两棵二叉搜索树中的所有元素](https://leetcode-cn.com/problems/all-elements-in-two-binary-search-trees/) [1379. 找出克隆二叉树中的相同节点](https://leetcode-cn.com/problems/find-a-corresponding-node-of-a-binary-tree-in-a-clone-of-that-tree/) [1382. 将二叉搜索树变平衡](https://leetcode-cn.com/problems/balance-a-binary-search-tree/) [1448. 统计二叉树中好节点的数目](https://leetcode-cn.com/problems/count-good-nodes-in-binary-tree/) [1457. 二叉树中的伪回文路径](https://leetcode-cn.com/problems/pseudo-palindromic-paths-in-a-binary-tree/) [面试题 04.05. 合法二叉搜索树](https://leetcode-cn.com/problems/legal-binary-search-tree-lcci/) [面试题 04.06. 后继者](https://leetcode-cn.com/problems/successor-lcci/) [面试题 04.08. 首个共同祖先](https://leetcode-cn.com/problems/first-common-ancestor-lcci/) [面试题 04.10. 检查子树](https://leetcode-cn.com/problems/check-subtree-lcci/) [面试题 17.12. BiNode](https://leetcode-cn.com/problems/binode-lcci/) [剑指 Offer 07. 重建二叉树](https://leetcode-cn.com/problems/zhong-jian-er-cha-shu-lcof/)(与 105 同) [剑指 Offer 26. 树的子结构](https://leetcode-cn.com/problems/shu-de-zi-jie-gou-lcof/) [剑指 Offer 34. 二叉树中和为某一值的路径](https://leetcode-cn.com/problems/er-cha-shu-zhong-he-wei-mou-yi-zhi-de-lu-jing-lcof/)(与 113 同) [剑指 Offer 36. 二叉搜索树与双向链表](https://leetcode-cn.com/problems/er-cha-sou-suo-shu-yu-shuang-xiang-lian-biao-lcof/) [剑指 Offer 37. 序列化二叉树](https://leetcode-cn.com/problems/xu-lie-hua-er-cha-shu-lcof/)(与 297 同) ### (Graph)图 > 联想词:邻接表、邻接矩阵 [133. 克隆图](https://leetcode-cn.com/problems/clone-graph/) [207. 课程表](https://leetcode-cn.com/problems/course-schedule/) [210. 课程表 II](https://leetcode-cn.com/problems/course-schedule-ii/) [797. 所有可能的路径](https://leetcode-cn.com/problems/all-paths-from-source-to-target/) [1042. 不邻接植花](https://leetcode-cn.com/problems/flower-planting-with-no-adjacent/) [1791. 找出星型图的中心节点](https://leetcode-cn.com/problems/find-center-of-star-graph/) ### (Stack)栈 > 联想词:先进后出(后进先出) [20. 有效的括号](https://leetcode-cn.com/problems/valid-parentheses/)(与 1003 相似) [32. 最长有效括号](https://leetcode-cn.com/problems/longest-valid-parentheses/) [85. 最大矩形](https://leetcode-cn.com/problems/maximal-rectangle/)(与 84 相似) [150. 逆波兰表达式求值](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/) [155. 最小栈](https://leetcode-cn.com/problems/min-stack/) [224. 基本计算器](https://leetcode-cn.com/problems/basic-calculator/) [225. 用队列实现栈](https://leetcode-cn.com/problems/implement-stack-using-queues/) [232. 用栈实现队列](https://leetcode-cn.com/problems/implement-queue-using-stacks/) [284. 顶端迭代器](https://leetcode-cn.com/problems/peeking-iterator/) [341. 扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator/)(与 385 相似) [385. 迷你语法分析器](https://leetcode-cn.com/problems/mini-parser/)(与 341 相似) [503. 下一个更大元素 II](https://leetcode-cn.com/problems/next-greater-element-ii/) [591. 标签验证器](https://leetcode-cn.com/problems/tag-validator/) [636. 函数的独占时间](https://leetcode-cn.com/problems/exclusive-time-of-functions/) [844. 比较含退格的字符串](https://leetcode-cn.com/problems/backspace-string-compare/) [880. 索引处的解码字符串](https://leetcode-cn.com/problems/decoded-string-at-index/) [895. 最大频率栈](https://leetcode-cn.com/problems/maximum-frequency-stack/) [901. 股票价格跨度](https://leetcode-cn.com/problems/online-stock-span/) [946. 验证栈序列](https://leetcode-cn.com/problems/validate-stack-sequences/) [1003. 检查替换后的词是否有效](https://leetcode-cn.com/problems/check-if-word-is-valid-after-substitutions/)(与 20 相似) [1019. 链表中的下一个更大节点](https://leetcode-cn.com/problems/next-greater-node-in-linked-list/) [1047. 删除字符串中的所有相邻重复项](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/) [1124. 表现良好的最长时间段](https://leetcode-cn.com/problems/longest-well-performing-interval/) [1381. 设计一个支持增量操作的栈](https://leetcode-cn.com/problems/design-a-stack-with-increment-operation/) [面试题 03.01. 三合一](https://leetcode-cn.com/problems/three-in-one-lcci/) [面试题 03.02. 栈的最小值](https://leetcode-cn.com/problems/min-stack-lcci/) [面试题 03.04. 化栈为队](https://leetcode-cn.com/problems/implement-queue-using-stacks-lcci/) [面试题 03.05. 栈排序](https://leetcode-cn.com/problems/sort-of-stacks-lcci/) [面试题 17.21. 直方图的水量](https://leetcode-cn.com/problems/volume-of-histogram-lcci/)(与 42 同) [剑指 Offer 09. 用两个栈实现队列](https://leetcode-cn.com/problems/yong-liang-ge-zhan-shi-xian-dui-lie-lcof/) [剑指 Offer 30. 包含min函数的栈](https://leetcode-cn.com/problems/bao-han-minhan-shu-de-zhan-lcof/) [剑指 Offer 31. 栈的压入、弹出序列](https://leetcode-cn.com/problems/zhan-de-ya-ru-dan-chu-xu-lie-lcof/)(与 946 同) ### (Heap)堆 > 联想词:优先队列 [295. 数据流的中位数](https://leetcode-cn.com/problems/find-median-from-data-stream/) [480. 滑动窗口中位数](https://leetcode-cn.com/problems/sliding-window-median/) [1792. 最大平均通过率](https://leetcode-cn.com/problems/maximum-average-pass-ratio/) [面试题 17.20. 连续中值](https://leetcode-cn.com/problems/continuous-median-lcci/)(与 295 同) [剑指 Offer 41. 数据流中的中位数](https://leetcode-cn.com/problems/shu-ju-liu-zhong-de-zhong-wei-shu-lcof/)(与 295 同) ### (Array)数组 > 联想词:双指针、排序、前缀和 [31. 下一个排列](https://leetcode-cn.com/problems/next-permutation/) [41. 缺失的第一个正数](https://leetcode-cn.com/problems/first-missing-positive/) [42. 接雨水](https://leetcode-cn.com/problems/trapping-rain-water/) [48. 旋转图像](https://leetcode-cn.com/problems/rotate-image/) [54. 螺旋矩阵](https://leetcode-cn.com/problems/spiral-matrix/) [59. 螺旋矩阵 II](https://leetcode-cn.com/problems/spiral-matrix-ii/)(与 54 相似) [73. 矩阵置零](https://leetcode-cn.com/problems/set-matrix-zeroes/) [84. 柱状图中最大的矩形](https://leetcode-cn.com/problems/largest-rectangle-in-histogram/)(与 85 相似) [118. 杨辉三角](https://leetcode-cn.com/problems/pascals-triangle/) [217. 存在重复元素](https://leetcode-cn.com/problems/contains-duplicate/) [240. 搜索二维矩阵 II](https://leetcode-cn.com/problems/search-a-2d-matrix-ii/)(与 面试题 10.09 同) [303. 区域和检索 - 数组不可变](https://leetcode-cn.com/problems/range-sum-query-immutable/) [384. 打乱数组](https://leetcode-cn.com/problems/shuffle-an-array/) [419. 甲板上的战舰](https://leetcode-cn.com/problems/battleships-in-a-board/) [463. 岛屿的周长](https://leetcode-cn.com/problems/island-perimeter/) [495. 提莫攻击](https://leetcode-cn.com/problems/teemo-attacking/) [509. 斐波那契数](https://leetcode-cn.com/problems/fibonacci-number/) [566. 重塑矩阵](https://leetcode-cn.com/problems/reshape-the-matrix/) [665. 非递减数列](https://leetcode-cn.com/problems/non-decreasing-array/) [674. 最长连续递增序列](https://leetcode-cn.com/problems/longest-continuous-increasing-subsequence/) [697. 数组的度](https://leetcode-cn.com/problems/degree-of-an-array/) [724. 寻找数组的中心索引](https://leetcode-cn.com/problems/find-pivot-index/) [766. 托普利茨矩阵](https://leetcode-cn.com/problems/toeplitz-matrix/) [794. 有效的井字游戏](https://leetcode-cn.com/problems/valid-tic-tac-toe-state/) [795. 区间子数组个数](https://leetcode-cn.com/problems/number-of-subarrays-with-bounded-maximum/)(与 992 相似) [830. 较大分组的位置](https://leetcode-cn.com/problems/positions-of-large-groups/) [832. 翻转图像](https://leetcode-cn.com/problems/flipping-an-image/) [867. 转置矩阵](https://leetcode-cn.com/problems/transpose-matrix/) [896. 单调数列](https://leetcode-cn.com/problems/monotonic-array/) [922. 按奇偶排序数组 II](https://leetcode-cn.com/problems/sort-array-by-parity-ii/) [941. 有效的山脉数组](https://leetcode-cn.com/problems/valid-mountain-array/) [950. 按递增顺序显示卡牌](https://leetcode-cn.com/problems/reveal-cards-in-increasing-order/) [962. 最大宽度坡](https://leetcode-cn.com/problems/maximum-width-ramp/) [999. 可以被一步捕获的棋子数](https://leetcode-cn.com/problems/available-captures-for-rook/) [1014. 最佳观光组合](https://leetcode-cn.com/problems/best-sightseeing-pair/) [1094. 拼车](https://leetcode-cn.com/problems/car-pooling/)(1589,面试题 16.10. 生存人数 相似) [1122. 数组的相对排序](https://leetcode-cn.com/problems/relative-sort-array/) [1146. 快照数组](https://leetcode-cn.com/problems/snapshot-array/) [1184. 公交站间的距离](https://leetcode-cn.com/problems/distance-between-bus-stops/) [1275. 找出井字棋的获胜者](https://leetcode-cn.com/problems/find-winner-on-a-tic-tac-toe-game/) [1314. 矩阵区域和](https://leetcode-cn.com/problems/matrix-block-sum/) [1472. 设计浏览器历史记录](https://leetcode-cn.com/problems/design-browser-history/) [1476. 子矩形查询](https://leetcode-cn.com/problems/subrectangle-queries/) [1486. 数组异或操作](https://leetcode-cn.com/problems/xor-operation-in-an-array/) [1560. 圆形赛道上经过次数最多的扇区](https://leetcode-cn.com/problems/most-visited-sector-in-a-circular-track/) [1582. 二进制矩阵中的特殊位置](https://leetcode-cn.com/problems/special-positions-in-a-binary-matrix/) [1583. 统计不开心的朋友](https://leetcode-cn.com/problems/count-unhappy-friends/) [1603. 设计停车系统](https://leetcode-cn.com/problems/design-parking-system/) [1629. 按键持续时间最长的键](https://leetcode-cn.com/problems/slowest-key/) [1672. 最富有客户的资产总量](https://leetcode-cn.com/problems/richest-customer-wealth/) [1700. 无法吃午餐的学生数量](https://leetcode-cn.com/problems/number-of-students-unable-to-eat-lunch/) [1725. 可以形成最大正方形的矩形数目](https://leetcode-cn.com/problems/number-of-rectangles-that-can-form-the-largest-square/) [1732. 找到最高海拔](https://leetcode-cn.com/problems/find-the-highest-altitude/) [1742. 盒子中小球的最大数量](https://leetcode-cn.com/problems/maximum-number-of-balls-in-a-box/) [1752. 检查数组是否经排序和轮转得到](https://leetcode-cn.com/problems/check-if-array-is-sorted-and-rotated/) [1764. 通过连接另一个数组的子数组得到一个数组](https://leetcode-cn.com/problems/form-array-by-concatenating-subarrays-of-another-array/) [1779. 找到最近的有相同 X 或 Y 坐标的点](https://leetcode-cn.com/problems/find-nearest-point-that-has-the-same-x-or-y-coordinate/) [1800. 最大升序子数组和](https://leetcode-cn.com/problems/maximum-ascending-subarray-sum/) [1827. 最少操作使数组递增](https://leetcode-cn.com/problems/minimum-operations-to-make-the-array-increasing/) [1854. 人口最多的年份](https://leetcode-cn.com/problems/maximum-population-year/) [1877. 数组中最大数对和的最小值](https://leetcode-cn.com/problems/minimize-maximum-pair-sum-in-array/) [1886. 判断矩阵经轮转后是否一致](https://leetcode-cn.com/problems/determine-whether-matrix-can-be-obtained-by-rotation/) [1893. 检查是否区域内所有整数都被覆盖](https://leetcode-cn.com/problems/check-if-all-the-integers-in-a-range-are-covered/) [1920. 基于排列构建数组](https://leetcode-cn.com/problems/build-array-from-permutation/) [1929. 数组串联](https://leetcode-cn.com/problems/concatenation-of-array/) [面试题 01.07. 旋转矩阵](https://leetcode-cn.com/problems/rotate-matrix-lcci/)(与 48 同) [面试题 01.08. 零矩阵](https://leetcode-cn.com/problems/zero-matrix-lcci/)(与 73 同) [面试题 10.11. 峰与谷](https://leetcode-cn.com/problems/peaks-and-valleys-lcci/) [面试题 16.04. 井字游戏](https://leetcode-cn.com/problems/tic-tac-toe-lcci/) [面试题 16.10. 生存人数](https://leetcode-cn.com/problems/living-people-lcci/)(与 1094,1589相似) [面试题 16.15. 珠玑妙算](https://leetcode-cn.com/problems/master-mind-lcci/)(与 299 同) [剑指 Offer 04. 二维数组中的查找](https://leetcode-cn.com/problems/er-wei-shu-zu-zhong-de-cha-zhao-lcof/)(与 240 同) [剑指 Offer 61. 扑克牌中的顺子](https://leetcode-cn.com/problems/bu-ke-pai-zhong-de-shun-zi-lcof/) ### (Simulation)模拟 [1860. 增长的内存泄露](https://leetcode-cn.com/problems/incremental-memory-leak/) ### (Math)数学 > 联想词:找规律 [7. 整数反转](https://leetcode-cn.com/problems/reverse-integer/)(与 8,190 相似) [60. 排列序列](https://leetcode-cn.com/problems/permutation-sequence/) [65. 有效数字](https://leetcode-cn.com/problems/valid-number/) [166. 分数到小数](https://leetcode-cn.com/problems/fraction-to-recurring-decimal/) [204. 计数质数](https://leetcode-cn.com/problems/count-primes/) [223. 矩形面积](https://leetcode-cn.com/problems/rectangle-area/) [233. 数字 1 的个数](https://leetcode-cn.com/problems/number-of-digit-one/) [273. 整数转换英文表示](https://leetcode-cn.com/problems/integer-to-english-words/) [343. 整数拆分](https://leetcode-cn.com/problems/integer-break/) [357. 计算各个位数不同的数字个数](https://leetcode-cn.com/problems/count-numbers-with-unique-digits/) [365. 水壶问题](https://leetcode-cn.com/problems/water-and-jug-problem/) [390. 消除游戏](https://leetcode-cn.com/problems/elimination-game/) [400. 第N个数字](https://leetcode-cn.com/problems/nth-digit/) [458. 可怜的小猪](https://leetcode-cn.com/problems/poor-pigs/) [537. 复数乘法](https://leetcode-cn.com/problems/complex-number-multiplication/) [628. 三个数的最大乘积](https://leetcode-cn.com/problems/maximum-product-of-three-numbers/) [781. 森林中的兔子](https://leetcode-cn.com/problems/rabbits-in-forest/) [810. 黑板异或游戏](https://leetcode-cn.com/problems/chalkboard-xor-game/) [836. 矩形重叠](https://leetcode-cn.com/problems/rectangle-overlap/) [883. 三维形体投影面积](https://leetcode-cn.com/problems/projection-area-of-3d-shapes/) [892. 三维形体的表面积](https://leetcode-cn.com/problems/surface-area-of-3d-shapes/) [970. 强整数](https://leetcode-cn.com/problems/powerful-integers/) [976. 三角形的最大周长](https://leetcode-cn.com/problems/largest-perimeter-triangle/) [1006. 笨阶乘](https://leetcode-cn.com/problems/clumsy-factorial/) [1025. 除数博弈](https://leetcode-cn.com/problems/divisor-game/) [1041. 困于环中的机器人](https://leetcode-cn.com/problems/robot-bounded-in-circle/) [1175. 质数排列](https://leetcode-cn.com/problems/prime-arrangements/) [1276. 不浪费原料的汉堡制作方案](https://leetcode-cn.com/problems/number-of-burgers-with-no-waste-of-ingredients/) [1551. 使数组中所有元素相等的最小操作数](https://leetcode-cn.com/problems/minimum-operations-to-make-array-equal/) [1630. 等差子数组](https://leetcode-cn.com/problems/arithmetic-subarrays/) [1685. 有序数组中差绝对值之和](https://leetcode-cn.com/problems/sum-of-absolute-differences-in-a-sorted-array/) [1688. 比赛中的配对次数](https://leetcode-cn.com/problems/count-of-matches-in-tournament/) [1716. 计算力扣银行的钱](https://leetcode-cn.com/problems/calculate-money-in-leetcode-bank/) [1744. 你能在你最喜欢的那天吃到你最喜欢的糖果吗?](https://leetcode-cn.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day/) [1753. 移除石子的最大得分](https://leetcode-cn.com/problems/maximum-score-from-removing-stones/) [1780. 判断一个数字是否可以表示成三的幂的和](https://leetcode-cn.com/problems/check-if-number-is-a-sum-of-powers-of-three/) [1822. 数组元素积的符号](https://leetcode-cn.com/problems/sign-of-the-product-of-an-array/) [1828. 统计一个圆中点的数目](https://leetcode-cn.com/problems/queries-on-number-of-points-inside-a-circle/) [1837. K 进制表示下的各位数字总和](https://leetcode-cn.com/problems/sum-of-digits-in-base-k/) [1925. 统计平方和三元组的数目](https://leetcode-cn.com/problems/count-square-sum-triples/) [1952. 三除数](https://leetcode-cn.com/problems/three-divisors/) [1979. 找出数组的最大公约数](https://leetcode-cn.com/problems/find-greatest-common-divisor-of-array/) [面试题 05.02. 二进制数转字符串](https://leetcode-cn.com/problems/bianry-number-to-string-lcci/) [面试题 16.08. 整数的英语表示](https://leetcode-cn.com/problems/english-int-lcci/)(与 273 同) [面试题 16.11. 跳水板](https://leetcode-cn.com/problems/diving-board-lcci/) [面试题 16.21. 交换和](https://leetcode-cn.com/problems/sum-swap-lcci/) [面试题 17.06. 2出现的次数](https://leetcode-cn.com/problems/number-of-2s-in-range-lcci/)(与 233 相似) [剑指 Offer 14- I. 剪绳子](https://leetcode-cn.com/problems/jian-sheng-zi-lcof/)(与 343 同) [剑指 Offer 14- II. 剪绳子 II](https://leetcode-cn.com/problems/jian-sheng-zi-ii-lcof/) [剑指 Offer 16. 数值的整数次方](https://leetcode-cn.com/problems/shu-zhi-de-zheng-shu-ci-fang-lcof/)(与 50 同) [剑指 Offer 20. 表示数值的字符串](https://leetcode-cn.com/problems/biao-shi-shu-zhi-de-zi-fu-chuan-lcof/)(与 65 同) [剑指 Offer 43. 1~n 整数中 1 出现的次数](https://leetcode-cn.com/problems/1nzheng-shu-zhong-1chu-xian-de-ci-shu-lcof/)(与 233 同) [剑指 Offer 44. 数字序列中某一位的数字](https://leetcode-cn.com/problems/shu-zi-xu-lie-zhong-mou-yi-wei-de-shu-zi-lcof/)(与 400 同) [剑指 Offer 49. 丑数](https://leetcode-cn.com/problems/chou-shu-lcof/)(与 264 同) [剑指 Offer 62. 圆圈中最后剩下的数字](https://leetcode-cn.com/problems/yuan-quan-zhong-zui-hou-sheng-xia-de-shu-zi-lcof/) [剑指 Offer 64. 求1+2+…+n](https://leetcode-cn.com/problems/qiu-12n-lcof/) [剑指 Offer 67. 把字符串转换成整数](https://leetcode-cn.com/problems/ba-zi-fu-chuan-zhuan-huan-cheng-zheng-shu-lcof/)(与 8 同) ### (Sort)排序 [56. 合并区间](https://leetcode-cn.com/problems/merge-intervals/) [57. 插入区间](https://leetcode-cn.com/problems/insert-interval/) [164. 最大间距](https://leetcode-cn.com/problems/maximum-gap/) [179. 最大数](https://leetcode-cn.com/problems/largest-number/) [220. 存在重复元素 III](https://leetcode-cn.com/problems/contains-duplicate-iii/) [274. H 指数](https://leetcode-cn.com/problems/h-index/) [315. 计算右侧小于当前元素的个数](https://leetcode-cn.com/problems/count-of-smaller-numbers-after-self/) [327. 区间和的个数](https://leetcode-cn.com/problems/count-of-range-sum/) [350. 两个数组的交集 II](https://leetcode-cn.com/problems/intersection-of-two-arrays-ii/)(与 349,1002 相似) [493. 翻转对](https://leetcode-cn.com/problems/reverse-pairs/)(归并排序) [561. 数组拆分 I](https://leetcode-cn.com/problems/array-partition-i/) [912. 排序数组](https://leetcode-cn.com/problems/sort-an-array/) [973. 最接近原点的 K 个点](https://leetcode-cn.com/problems/k-closest-points-to-origin/) [1561. 你可以获得的最大硬币数目](https://leetcode-cn.com/problems/maximum-number-of-coins-you-can-get/) [1619. 删除某些元素后的数组均值](https://leetcode-cn.com/problems/mean-of-array-after-removing-some-elements/) [1636. 按照频率将数组升序排序](https://leetcode-cn.com/problems/sort-array-by-increasing-frequency/) [1637. 两点之间不包含任何点的最宽垂直面积](https://leetcode-cn.com/problems/widest-vertical-area-between-two-points-containing-no-points/) [1727. 重新排列后的最大子矩阵](https://leetcode-cn.com/problems/largest-submatrix-with-rearrangements/)(与 84,85 相似) [1833. 雪糕的最大数量](https://leetcode-cn.com/problems/maximum-ice-cream-bars/) [1913. 两个数对之间的最大乘积差](https://leetcode-cn.com/problems/maximum-product-difference-between-two-pairs/) [面试题 16.16. 部分排序](https://leetcode-cn.com/problems/sub-sort-lcci/) [面试题 17.14. 最小K个数](https://leetcode-cn.com/problems/smallest-k-lcci/) [剑指 Offer 45. 把数组排成最小的数](https://leetcode-cn.com/problems/ba-shu-zu-pai-cheng-zui-xiao-de-shu-lcof/) [剑指 Offer 51. 数组中的逆序对](https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/) ### (Recursion)递归 > 记忆化、子问题、结束条件、剪枝 [95. 不同的二叉搜索树 II](https://leetcode-cn.com/problems/unique-binary-search-trees-ii/)(动态规划,卡塔兰数) [96. 不同的二叉搜索树](https://leetcode-cn.com/problems/unique-binary-search-trees/)(与 241 相似) [726. 原子的数量](https://leetcode-cn.com/problems/number-of-atoms/) [894. 所有可能的满二叉树](https://leetcode-cn.com/problems/all-possible-full-binary-trees/) [面试题 08.05. 递归乘法](https://leetcode-cn.com/problems/recursive-mulitply-lcci/) [面试题 08.06. 汉诺塔问题](https://leetcode-cn.com/problems/hanota-lcci/) ### (Queue)队列 > 联想词:先进先出(后进后出) [622. 设计循环队列](https://leetcode-cn.com/problems/design-circular-queue/) [641. 设计循环双端队列](https://leetcode-cn.com/problems/design-circular-deque/) [703. 数据流中的第K大元素](https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/) [933. 最近的请求次数](https://leetcode-cn.com/problems/number-of-recent-calls/) [面试题 03.06. 动物收容所](https://leetcode-cn.com/problems/animal-shelter-lcci/) [剑指 Offer 59 - II. 队列的最大值](https://leetcode-cn.com/problems/dui-lie-de-zui-da-zhi-lcof/) ### (Linked List)链表 > 联想词:双指针(快慢指针)、迭代(自顶向下)、环、递归(自底向上) [2. 两数相加](https://leetcode-cn.com/problems/add-two-numbers/) [19. 删除链表的倒数第N个节点](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/) [21. 合并两个有序链表](https://leetcode-cn.com/problems/merge-two-sorted-lists/)(与 88 相似) [23. 合并K个升序链表](https://leetcode-cn.com/problems/merge-k-sorted-lists/) [24. 两两交换链表中的节点](https://leetcode-cn.com/problems/swap-nodes-in-pairs/) [25. K 个一组翻转链表](https://leetcode-cn.com/problems/reverse-nodes-in-k-group/) [61. 旋转链表](https://leetcode-cn.com/problems/rotate-list/) [82. 删除排序链表中的重复元素 II](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list-ii/) [86. 分隔链表](https://leetcode-cn.com/problems/partition-list/) [92. 反转链表 II](https://leetcode-cn.com/problems/reverse-linked-list-ii/) [138. 复制带随机指针的链表](https://leetcode-cn.com/problems/copy-list-with-random-pointer/) [141. 环形链表](https://leetcode-cn.com/problems/linked-list-cycle/) [142. 环形链表 II](https://leetcode-cn.com/problems/linked-list-cycle-ii/) [143. 重排链表](https://leetcode-cn.com/problems/reorder-list/) [146. LRU缓存机制](https://leetcode-cn.com/problems/lru-cache/)(LRU:最近最少使用算法,它是根据**时间**维度来选择将要淘汰的元素,即删除掉最长时间没被访问的元素。) [147. 对链表进行插入排序](https://leetcode-cn.com/problems/insertion-sort-list/) [148. 排序链表](https://leetcode-cn.com/problems/sort-list/) [234. 回文链表](https://leetcode-cn.com/problems/palindrome-linked-list/) [328. 奇偶链表](https://leetcode-cn.com/problems/odd-even-linked-list/) [355. 设计推特](https://leetcode-cn.com/problems/design-twitter/) [460. LFU 缓存](https://leetcode-cn.com/problems/lfu-cache/)(LFU:最近最不常用算法,它是根据**频率**维度来选择将要淘汰的元素,即删除访问频率最低的元素。如果两个元素的访问频率相同,则淘汰最久没被访问的元素。) [707. 设计链表](https://leetcode-cn.com/problems/design-linked-list/) [1171. 从链表中删去总和值为零的连续节点](https://leetcode-cn.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list/) [面试题 02.04. 分割链表](https://leetcode-cn.com/problems/partition-list-lcci/) [面试题 02.05. 链表求和](https://leetcode-cn.com/problems/sum-lists-lcci/) [面试题 02.07. 链表相交](https://leetcode-cn.com/problems/intersection-of-two-linked-lists-lcci/) [面试题 02.08. 环路检测](https://leetcode-cn.com/problems/linked-list-cycle-lcci/)(与 142 同) [面试题 16.25. LRU缓存](https://leetcode-cn.com/problems/lru-cache-lcci/)(与 146 同) [剑指 Offer 35. 复杂链表的复制](https://leetcode-cn.com/problems/fu-za-lian-biao-de-fu-zhi-lcof/)(与 138 同) ### (String)字符串 [8. 字符串转换整数 (atoi)](https://leetcode-cn.com/problems/string-to-integer-atoi/)(与 7 相似) [28. 实现 strStr()](https://leetcode-cn.com/problems/implement-strstr/) [227. 基本计算器 II](https://leetcode-cn.com/problems/basic-calculator-ii/)(与 面试题 16.26 同) [344. 反转字符串](https://leetcode-cn.com/problems/reverse-string/) [925. 长按键入](https://leetcode-cn.com/problems/long-pressed-name/) [937. 重新排列日志文件](https://leetcode-cn.com/problems/reorder-data-in-log-files/) [1138. 字母板上的路径](https://leetcode-cn.com/problems/alphabet-board-path/) [1370. 上升下降字符串](https://leetcode-cn.com/problems/increasing-decreasing-string/) [1624. 两个相同字符之间的最长子字符串](https://leetcode-cn.com/problems/largest-substring-between-two-equal-characters/) [1662. 检查两个字符串数组是否相等](https://leetcode-cn.com/problems/check-if-two-string-arrays-are-equivalent/) [1668. 最大重复子字符串](https://leetcode-cn.com/problems/maximum-repeating-substring/) [1684. 统计一致字符串的数目](https://leetcode-cn.com/problems/count-the-number-of-consistent-strings/) [1694. 重新格式化电话号码](https://leetcode-cn.com/problems/reformat-phone-number/) [1736. 替换隐藏数字得到的最晚时间](https://leetcode-cn.com/problems/latest-time-by-replacing-hidden-digits/) [1759. 统计同构子字符串的数目](https://leetcode-cn.com/problems/count-number-of-homogenous-substrings/) [1763. 最长的美好子字符串](https://leetcode-cn.com/problems/longest-nice-substring/) [1768. 交替合并字符串](https://leetcode-cn.com/problems/merge-strings-alternately/) [1773. 统计匹配检索规则的物品数量](https://leetcode-cn.com/problems/count-items-matching-a-rule/) [1781. 所有子字符串美丽值之和](https://leetcode-cn.com/problems/sum-of-beauty-of-all-substrings/) [1784. 检查二进制字符串字段](https://leetcode-cn.com/problems/check-if-binary-string-has-at-most-one-segment-of-ones/) [1790. 仅执行一次字符串交换能否使两个字符串相等](https://leetcode-cn.com/problems/check-if-one-string-swap-can-make-strings-equal/) [1796. 字符串中第二大的数字](https://leetcode-cn.com/problems/second-largest-digit-in-a-string/) [1805. 字符串中不同整数的数目](https://leetcode-cn.com/problems/number-of-different-integers-in-a-string/) [1832. 判断句子是否为全字母句](https://leetcode-cn.com/problems/check-if-the-sentence-is-pangram/) [1844. 将所有数字用字符替换](https://leetcode-cn.com/problems/replace-all-digits-with-characters/) [1859. 将句子排序](https://leetcode-cn.com/problems/sorting-the-sentence/) [1869. 哪种连续子字符串更长](https://leetcode-cn.com/problems/longer-contiguous-segments-of-ones-than-zeros/) [1876. 长度为三且各字符不同的子字符串](https://leetcode-cn.com/problems/substrings-of-size-three-with-distinct-characters/) [1880. 检查某单词是否等于两单词之和](https://leetcode-cn.com/problems/check-if-word-equals-summation-of-two-words/) [1897. 重新分配字符使所有字符串都相等](https://leetcode-cn.com/problems/redistribute-characters-to-make-all-strings-equal/) [1903. 字符串中的最大奇数](https://leetcode-cn.com/problems/largest-odd-number-in-string/) [1935. 可以输入的最大单词数](https://leetcode-cn.com/problems/maximum-number-of-words-you-can-type/) [1945. 字符串转化后的各位数字之和](https://leetcode-cn.com/problems/sum-of-digits-of-string-after-convert/) [1957. 删除字符使字符串变好](https://leetcode-cn.com/problems/delete-characters-to-make-fancy-string/) [1961. 检查字符串是否为数组前缀](https://leetcode-cn.com/problems/check-if-string-is-a-prefix-of-array/) [1967. 作为子字符串出现在单词中的字符串数目](https://leetcode-cn.com/problems/number-of-strings-that-appear-as-substrings-in-word/) [面试题 16.26. 计算器](https://leetcode-cn.com/problems/calculator-lcci/)(与 227 同) ### (Trie)前缀树 > 联想词:字典树 [208. 实现 Trie (前缀树)](https://leetcode-cn.com/problems/implement-trie-prefix-tree/) [211. 添加与搜索单词 - 数据结构设计](https://leetcode-cn.com/problems/design-add-and-search-words-data-structure/) [212. 单词搜索 II](https://leetcode-cn.com/problems/word-search-ii/) [421. 数组中两个数的最大异或值](https://leetcode-cn.com/problems/maximum-xor-of-two-numbers-in-an-array/) [472. 连接词](https://leetcode-cn.com/problems/concatenated-words/)(与 面试题 17.15. 最长单词 相似) [676. 实现一个魔法字典](https://leetcode-cn.com/problems/implement-magic-dictionary/) [677. 键值映射](https://leetcode-cn.com/problems/map-sum-pairs/) ### (Threads)多线程 [1114. 按序打印](https://leetcode-cn.com/problems/print-in-order/) [1115. 交替打印FooBar](https://leetcode-cn.com/problems/print-foobar-alternately/) [1116. 打印零与奇偶数](https://leetcode-cn.com/problems/print-zero-even-odd/) [1195. 交替打印字符串](https://leetcode-cn.com/problems/fizz-buzz-multithreaded/) ### (HashTable)哈希表 [1. 两数之和](https://leetcode-cn.com/problems/two-sum/) [49. 字母异位词分组](https://leetcode-cn.com/problems/group-anagrams/) [205. 同构字符串](https://leetcode-cn.com/problems/isomorphic-strings/) [242. 有效的字母异位词](https://leetcode-cn.com/problems/valid-anagram/) [290. 单词规律](https://leetcode-cn.com/problems/word-pattern/) [299. 猜数字游戏](https://leetcode-cn.com/problems/bulls-and-cows/)(与 面试题 16.15. 珠玑妙算 同) [349. 两个数组的交集](https://leetcode-cn.com/problems/intersection-of-two-arrays/)(与 350,1002 相似) [380. 常数时间插入、删除和获取随机元素](https://leetcode-cn.com/problems/insert-delete-getrandom-o1/) [381. O(1) 时间插入、删除和获取随机元素 - 允许重复](https://leetcode-cn.com/problems/insert-delete-getrandom-o1-duplicates-allowed/) [387. 字符串中的第一个唯一字符](https://leetcode-cn.com/problems/first-unique-character-in-a-string/) [454. 四数相加 II](https://leetcode-cn.com/problems/4sum-ii/) [535. TinyURL 的加密与解密](https://leetcode-cn.com/problems/encode-and-decode-tinyurl/) [554. 砖墙](https://leetcode-cn.com/problems/brick-wall/) [705. 设计哈希集合](https://leetcode-cn.com/problems/design-hashset/) [706. 设计哈希映射](https://leetcode-cn.com/problems/design-hashmap/) [771. 宝石与石头](https://leetcode-cn.com/problems/jewels-and-stones/) [957. N 天后的牢房](https://leetcode-cn.com/problems/prison-cells-after-n-days/) [1002. 查找常用字符](https://leetcode-cn.com/problems/find-common-characters/)(与 349,1002 相似) [1207. 独一无二的出现次数](https://leetcode-cn.com/problems/unique-number-of-occurrences/) [1365. 有多少小于当前数字的数字](https://leetcode-cn.com/problems/how-many-numbers-are-smaller-than-the-current-number/) [1640. 能否连接形成数组](https://leetcode-cn.com/problems/check-array-formation-through-concatenation/) [1726. 同积元组](https://leetcode-cn.com/problems/tuple-with-same-product/)(与 1 相似) [1748. 唯一元素的和](https://leetcode-cn.com/problems/sum-of-unique-elements/) [1797. 设计一个验证系统](https://leetcode-cn.com/problems/design-authentication-manager/) [1941. 检查是否所有字符出现次数相同](https://leetcode-cn.com/problems/check-if-all-characters-have-equal-number-of-occurrences/) [面试题 10.02. 变位词组](https://leetcode-cn.com/problems/group-anagrams-lcci/) [面试题 16.02. 单词频率](https://leetcode-cn.com/problems/words-frequency-lcci/) [面试题 16.20. T9键盘](https://leetcode-cn.com/problems/t9-lcci/) [面试题 17.05. 字母与数字](https://leetcode-cn.com/problems/find-longest-subarray-lcci/) ### (Prefix_Sum)前缀和 [528. 按权重随机选择](https://leetcode-cn.com/problems/random-pick-with-weight/) [1109. 航班预订统计](https://leetcode-cn.com/problems/corporate-flight-bookings/) [1588. 所有奇数长度子数组的和](https://leetcode-cn.com/problems/sum-of-all-odd-length-subarrays/) ### (Randomized)随机化 [710. 黑名单中的随机数](https://leetcode-cn.com/problems/random-pick-with-blacklist/) ### (Two_Pointers)双指针 [18. 四数之和](https://leetcode-cn.com/problems/4sum/) [27. 移除元素](https://leetcode-cn.com/problems/remove-element/) [88. 合并两个有序数组](https://leetcode-cn.com/problems/merge-sorted-array/)(与 21 相似) [283. 移动零](https://leetcode-cn.com/problems/move-zeroes/) [633. 平方数之和](https://leetcode-cn.com/problems/sum-of-square-numbers/) [838. 推多米诺](https://leetcode-cn.com/problems/push-dominoes/) [845. 数组中的最长山脉](https://leetcode-cn.com/problems/longest-mountain-in-array/) [977. 有序数组的平方](https://leetcode-cn.com/problems/squares-of-a-sorted-array/) [986. 区间列表的交集](https://leetcode-cn.com/problems/interval-list-intersections/) [1750. 删除字符串两端相同字符后的最短长度](https://leetcode-cn.com/problems/minimum-length-of-string-after-deleting-similar-ends/) [1848. 到目标元素的最小距离](https://leetcode-cn.com/problems/minimum-distance-to-the-target-element/) [面试题 16.24. 数对和](https://leetcode-cn.com/problems/pairs-with-sum-lcci/) [面试题 17.11. 单词距离](https://leetcode-cn.com/problems/find-closest-lcci/) ### (Bit_Manipulation)位运算 > 联想词:异或、按位与 [29. 两数相除](https://leetcode-cn.com/problems/divide-two-integers/) [136. 只出现一次的数字](https://leetcode-cn.com/problems/single-number/) [137. 只出现一次的数字 II](https://leetcode-cn.com/problems/single-number-ii/) [190. 颠倒二进制位](https://leetcode-cn.com/problems/reverse-bits/)(与 7 相似) [191. 位1的个数](https://leetcode-cn.com/problems/number-of-1-bits/) [231. 2 的幂](https://leetcode-cn.com/problems/power-of-two/) [260. 只出现一次的数字 III](https://leetcode-cn.com/problems/single-number-iii/) [389. 找不同](https://leetcode-cn.com/problems/find-the-difference/) [401. 二进制手表](https://leetcode-cn.com/problems/binary-watch/) [461. 汉明距离](https://leetcode-cn.com/problems/hamming-distance/) [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) [1734. 解码异或后的排列](https://leetcode-cn.com/problems/decode-xored-permutation/) [面试题 05.01. 插入](https://leetcode-cn.com/problems/insert-into-bits-lcci/) [面试题 16.01. 交换数字](https://leetcode-cn.com/problems/swap-numbers-lcci/) [剑指 Offer 56 - I. 数组中数字出现的次数](https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof/)(与 260 同) [剑指 Offer 56 - II. 数组中数字出现的次数 II](https://leetcode-cn.com/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-ii-lcof/)(与 137 同) ### (Union Find)并查集 [128. 最长连续序列](https://leetcode-cn.com/problems/longest-consecutive-sequence/) [399. 除法求值](https://leetcode-cn.com/problems/evaluate-division/) [547. 省份数量](https://leetcode-cn.com/problems/number-of-provinces/) [1579. 保证图可完全遍历](https://leetcode-cn.com/problems/remove-max-number-of-edges-to-keep-graph-fully-traversable/) [1584. 连接所有点的最小费用](https://leetcode-cn.com/problems/min-cost-to-connect-all-points/) ### (Segment Tree)线段树 > 联想词:平衡树(TreeMap) [352. 将数据流变为多个不相交区间](https://leetcode-cn.com/problems/data-stream-as-disjoint-intervals/) [715. Range 模块](https://leetcode-cn.com/problems/range-module/) [729. 我的日程安排表 I](https://leetcode-cn.com/problems/my-calendar-i/) [731. 我的日程安排表 II](https://leetcode-cn.com/problems/my-calendar-ii/) [732. 我的日程安排表 III](https://leetcode-cn.com/problems/my-calendar-iii/) ### (Greedy)贪心算法 [45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) [55. 跳跃游戏](https://leetcode-cn.com/problems/jump-game/) [121. 买卖股票的最佳时机](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock/) [122. 买卖股票的最佳时机 II](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-ii/) [134. 加油站](https://leetcode-cn.com/problems/gas-station/) [135. 分发糖果](https://leetcode-cn.com/problems/candy/) [316. 去除重复字母](https://leetcode-cn.com/problems/remove-duplicate-letters/) [321. 拼接最大数](https://leetcode-cn.com/problems/create-maximum-number/) [376. 摆动序列](https://leetcode-cn.com/problems/wiggle-subsequence/) [402. 移掉K位数字](https://leetcode-cn.com/problems/remove-k-digits/) [406. 根据身高重建队列](https://leetcode-cn.com/problems/queue-reconstruction-by-height/) [435. 无重叠区间](https://leetcode-cn.com/problems/non-overlapping-intervals/) [452. 用最少数量的箭引爆气球](https://leetcode-cn.com/problems/minimum-number-of-arrows-to-burst-balloons/) [455. 分发饼干](https://leetcode-cn.com/problems/assign-cookies/) [621. 任务调度器](https://leetcode-cn.com/problems/task-scheduler/) [649. Dota2 参议院](https://leetcode-cn.com/problems/dota2-senate/) [659. 分割数组为连续子序列](https://leetcode-cn.com/problems/split-array-into-consecutive-subsequences/) [714. 买卖股票的最佳时机含手续费](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/) [738. 单调递增的数字](https://leetcode-cn.com/problems/monotone-increasing-digits/) [763. 划分字母区间](https://leetcode-cn.com/problems/partition-labels/) [767. 重构字符串](https://leetcode-cn.com/problems/reorganize-string/) [860. 柠檬水找零](https://leetcode-cn.com/problems/lemonade-change/) [861. 翻转矩阵后的得分](https://leetcode-cn.com/problems/score-after-flipping-matrix/) [874. 模拟行走机器人](https://leetcode-cn.com/problems/walking-robot-simulation/) [881. 救生艇](https://leetcode-cn.com/problems/boats-to-save-people/) [942. 增减字符串匹配](https://leetcode.cn/problems/di-string-match/) [1046. 最后一块石头的重量](https://leetcode-cn.com/problems/last-stone-weight/) [1081. 不同字符的最小子序列](https://leetcode-cn.com/problems/smallest-subsequence-of-distinct-characters/)(与 316 同) [1217. 玩筹码](https://leetcode-cn.com/problems/minimum-cost-to-move-chips-to-the-same-position/) [1282. 用户分组](https://leetcode-cn.com/problems/group-the-people-given-the-group-size-they-belong-to/) [1402. 做菜顺序](https://leetcode-cn.com/problems/reducing-dishes/) [1589. 所有排列中的最大和](https://leetcode-cn.com/problems/maximum-sum-obtained-of-any-permutation/)(与 1094,面试题 16.10. 生存人数 相似) [1605. 给定行和列的和求可行矩阵](https://leetcode-cn.com/problems/find-valid-matrix-given-row-and-column-sums/) [1689. 十-二进制数的最少数目](https://leetcode-cn.com/problems/partitioning-into-minimum-number-of-deci-binary-numbers/) [1733. 需要教语言的最少人数](https://leetcode-cn.com/problems/minimum-number-of-people-to-teach/) [1737. 满足三条件之一需改变的最少字符数](https://leetcode-cn.com/problems/change-minimum-characters-to-satisfy-one-of-three-conditions/) [1743. 从相邻元素对还原数组](https://leetcode-cn.com/problems/restore-the-array-from-adjacent-pairs/) [1749. 任意子数组和的绝对值的最大值](https://leetcode-cn.com/problems/maximum-absolute-sum-of-any-subarray/) [1754. 构造字典序最大的合并字符串](https://leetcode-cn.com/problems/largest-merge-of-two-strings/) [1758. 生成交替二进制字符串的最少操作数](https://leetcode-cn.com/problems/minimum-changes-to-make-alternating-binary-string/) [1769. 移动所有球到每个盒子所需的最小操作数](https://leetcode-cn.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/) [1785. 构成特定和需要添加的最少元素](https://leetcode-cn.com/problems/minimum-elements-to-add-to-form-a-given-sum/) [1909. 删除一个元素使数组严格递增](https://leetcode-cn.com/problems/remove-one-element-to-make-the-array-strictly-increasing/) [1974. 使用特殊打字机键入单词的最少时间](https://leetcode-cn.com/problems/minimum-time-to-type-word-using-special-typewriter/) [剑指 Offer 63. 股票的最大利润](https://leetcode-cn.com/problems/gu-piao-de-zui-da-li-run-lcof/)(与 121 同) ### (Binary-Search)二分查找 [34. 在排序数组中查找元素的第一个和最后一个位置](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/) [81. 搜索旋转排序数组 II](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/) [153. 寻找旋转排序数组中的最小值](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/)(与 154,剑指 Offer 11 同) [154. 寻找旋转排序数组中的最小值 II](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/)(与 153,剑指 Offer 11 同) [222. 完全二叉树的节点个数](https://leetcode-cn.com/problems/count-complete-tree-nodes/) [378. 有序矩阵中第K小的元素](https://leetcode-cn.com/problems/kth-smallest-element-in-a-sorted-matrix/) [410. 分割数组的最大值](https://leetcode-cn.com/problems/split-array-largest-sum/)(与 875,1011 相似) [668. 乘法表中第k小的数](https://leetcode-cn.com/problems/kth-smallest-number-in-multiplication-table/)(与 378 相似) [875. 爱吃香蕉的珂珂](https://leetcode-cn.com/problems/koko-eating-bananas/)(与 410,1011 相似) [981. 基于时间的键值存储](https://leetcode-cn.com/problems/time-based-key-value-store/) [1011. 在 D 天内送达包裹的能力](https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/)(与 410,875 相似) [1095. 山脉数组中查找目标值](https://leetcode-cn.com/problems/find-in-mountain-array/) [1237. 找出给定方程的正整数解](https://leetcode-cn.com/problems/find-positive-integer-solution-for-a-given-equation/) [1760. 袋子里最少数目的球](https://leetcode-cn.com/problems/minimum-limit-of-balls-in-a-bag/) [面试题 10.09. 排序矩阵查找](https://leetcode-cn.com/problems/sorted-matrix-search-lcci/)(与 240 同) [剑指 Offer 11. 旋转数组的最小数字](https://leetcode-cn.com/problems/xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof/)(与 153,154 同) ### (Dynamic Programming)动态规划 > 联想词:dp 数组/矩阵、状态转移方程、求最优解(最少、最多、不同方式)、最值型问题 > > 经典题目:最长公共子序列、青蛙跳台阶、背包问题、填充矩阵 [10. 正则表达式匹配](https://leetcode-cn.com/problems/regular-expression-matching/) [44. 通配符匹配](https://leetcode-cn.com/problems/wildcard-matching/) [62. 不同路径](https://leetcode-cn.com/problems/unique-paths/) [63. 不同路径 II](https://leetcode-cn.com/problems/unique-paths-ii/) [64. 最小路径和](https://leetcode-cn.com/problems/minimum-path-sum/) [72. 编辑距离](https://leetcode-cn.com/problems/edit-distance/) [97. 交错字符串](https://leetcode-cn.com/problems/interleaving-string/) [119. 杨辉三角 II](https://leetcode-cn.com/problems/pascals-triangle-ii/) [120. 三角形最小路径和](https://leetcode-cn.com/problems/triangle/) [123. 买卖股票的最佳时机 III](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iii/) [132. 分割回文串 II](https://leetcode-cn.com/problems/palindrome-partitioning-ii/) [152. 乘积最大子数组](https://leetcode-cn.com/problems/maximum-product-subarray/) [174. 地下城游戏](https://leetcode-cn.com/problems/dungeon-game/) [188. 买卖股票的最佳时机 IV](https://leetcode-cn.com/problems/best-time-to-buy-and-sell-stock-iv/) [213. 打家劫舍 II](https://leetcode-cn.com/problems/house-robber-ii/) [279. 完全平方数](https://leetcode-cn.com/problems/perfect-squares/) [300. 最长上升子序列](https://leetcode-cn.com/problems/longest-increasing-subsequence/) [304. 二维区域和检索 - 矩阵不可变](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/) [312. 戳气球](https://leetcode-cn.com/problems/burst-balloons/) [474. 一和零](https://leetcode-cn.com/problems/ones-and-zeroes/) [712. 两个字符串的最小ASCII删除和](https://leetcode-cn.com/problems/minimum-ascii-delete-sum-for-two-strings/) [740. 删除并获得点数](https://leetcode-cn.com/problems/delete-and-earn/) [746. 使用最小花费爬楼梯](https://leetcode-cn.com/problems/min-cost-climbing-stairs/) [873. 最长的斐波那契子序列的长度](https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/) [978. 最长湍流子数组](https://leetcode-cn.com/problems/longest-turbulent-subarray/) [983. 最低票价](https://leetcode-cn.com/problems/minimum-cost-for-tickets/) [1035. 不相交的线](https://leetcode-cn.com/problems/uncrossed-lines/) [1043. 分隔数组以得到最大和](https://leetcode-cn.com/problems/partition-array-for-maximum-sum/) [1049. 最后一块石头的重量 II](https://leetcode-cn.com/problems/last-stone-weight-ii/) [1277. 统计全为 1 的正方形子矩阵](https://leetcode-cn.com/problems/count-square-submatrices-with-all-ones/) [1473. 粉刷房子 III](https://leetcode-cn.com/problems/paint-house-iii/) [1641. 统计字典序元音字符串的数目](https://leetcode-cn.com/problems/count-sorted-vowel-strings/) [1738. 找出第 K 大的异或坐标值](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/) [面试题 01.05. 一次编辑](https://leetcode-cn.com/problems/one-away-lcci/) [面试题 08.11. 硬币](https://leetcode-cn.com/problems/coin-lcci/) [剑指 Offer 19. 正则表达式匹配](https://leetcode-cn.com/problems/zheng-ze-biao-da-shi-pi-pei-lcof/)(与 10 相似) [剑指 Offer 46. 把数字翻译成字符串](https://leetcode-cn.com/problems/ba-shu-zi-fan-yi-cheng-zi-fu-chuan-lcof/)(青蛙跳台阶问题抽象版) [剑指 Offer 47. 礼物的最大价值](https://leetcode-cn.com/problems/li-wu-de-zui-da-jie-zhi-lcof/) [剑指 Offer 60. n个骰子的点数](https://leetcode-cn.com/problems/nge-tou-zi-de-dian-shu-lcof/) ### (Sliding_Window)滑动窗口 [3. 无重复字符的最长子串](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/) [30. 串联所有单词的子串](https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/) [76. 最小覆盖子串](https://leetcode-cn.com/problems/minimum-window-substring/) [239. 滑动窗口最大值](https://leetcode-cn.com/problems/sliding-window-maximum/) [992. K 个不同整数的子数组](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/)(与 795 相似) [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) [1052. 爱生气的书店老板](https://leetcode-cn.com/problems/grumpy-bookstore-owner/) [1208. 尽可能使字符串相等](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/) [剑指 Offer 48. 最长不含重复字符的子字符串](https://leetcode-cn.com/problems/zui-chang-bu-han-zhong-fu-zi-fu-de-zi-zi-fu-chuan-lcof/)(与 3 同) ### (Backtracking)回溯算法 > 经典题目:八皇后问题 [37. 解数独](https://leetcode-cn.com/problems/sudoku-solver/) [47. 全排列 II](https://leetcode-cn.com/problems/permutations-ii/) [51. N 皇后](https://leetcode-cn.com/problems/n-queens/) [52. N皇后 II](https://leetcode-cn.com/problems/n-queens-ii/) [78. 子集](https://leetcode-cn.com/problems/subsets/) [79. 单词搜索](https://leetcode-cn.com/problems/word-search/) [89. 格雷编码](https://leetcode-cn.com/problems/gray-code/) [90. 子集 II](https://leetcode-cn.com/problems/subsets-ii/) [124. 二叉树中的最大路径和](https://leetcode-cn.com/problems/binary-tree-maximum-path-sum/) [131. 分割回文串](https://leetcode-cn.com/problems/palindrome-partitioning/) [306. 累加数](https://leetcode-cn.com/problems/additive-number/)(与 842 相似) [784. 字母大小写全排列](https://leetcode-cn.com/problems/letter-case-permutation/) [842. 将数组拆分成斐波那契序列](https://leetcode-cn.com/problems/split-array-into-fibonacci-sequence/)(与 306 相似) [1286. 字母组合迭代器](https://leetcode-cn.com/problems/iterator-for-combination/) [1863. 找出所有子集的异或总和再求和](https://leetcode-cn.com/problems/sum-of-all-subset-xor-totals/) [面试题 08.04. 幂集](https://leetcode-cn.com/problems/power-set-lcci/)(与 78 同) [面试题 08.07. 无重复字符串的排列组合](https://leetcode-cn.com/problems/permutation-i-lcci/) [面试题 08.08. 有重复字符串的排列组合](https://leetcode-cn.com/problems/permutation-ii-lcci/) [面试题 08.09. 括号](https://leetcode-cn.com/problems/bracket-lcci/) [面试题 08.12. 八皇后](https://leetcode-cn.com/problems/eight-queens-lcci/)(与 51 同) [剑指 Offer 38. 字符串的排列](https://leetcode-cn.com/problems/zi-fu-chuan-de-pai-lie-lcof/)(与 47 同) ### (Devide And Conquer)分治算法 [241. 为运算表达式设计优先级](https://leetcode-cn.com/problems/different-ways-to-add-parentheses/)(与 95,96 相似) [395. 至少有 K 个重复字符的最长子串](https://leetcode-cn.com/problems/longest-substring-with-at-least-k-repeating-characters/) [932. 漂亮数组](https://leetcode-cn.com/problems/beautiful-array/) [剑指 Offer 33. 二叉搜索树的后序遍历序列](https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-hou-xu-bian-li-xu-lie-lcof/) ### (Reservoir Sampling)蓄水池抽样 [382. 链表随机节点](https://leetcode-cn.com/problems/linked-list-random-node/) [398. 随机数索引](https://leetcode-cn.com/problems/random-pick-index/) ### (Depth First Search)深度优先搜索 [329. 矩阵中的最长递增路径](https://leetcode-cn.com/problems/longest-increasing-path-in-a-matrix/) [430. 扁平化多级双向链表](https://leetcode-cn.com/problems/flatten-a-multilevel-doubly-linked-list/) [690. 员工的重要性](https://leetcode-cn.com/problems/employee-importance/) [827. 最大人工岛](https://leetcode-cn.com/problems/making-a-large-island/) [967. 连续差相同的数字](https://leetcode-cn.com/problems/numbers-with-same-consecutive-differences/) [980. 不同路径 III](https://leetcode-cn.com/problems/unique-paths-iii/) [1020. 飞地的数量](https://leetcode-cn.com/problems/number-of-enclaves/) [1034. 边框着色](https://leetcode-cn.com/problems/coloring-a-border/) [1254. 统计封闭岛屿的数目](https://leetcode-cn.com/problems/number-of-closed-islands/) [1293. 网格中的最短路径](https://leetcode-cn.com/problems/shortest-path-in-a-grid-with-obstacles-elimination/) [1391. 检查网格中是否存在有效路径](https://leetcode-cn.com/problems/check-if-there-is-a-valid-path-in-a-grid/) [1519. 子树中标签相同的节点数](https://leetcode-cn.com/problems/number-of-nodes-in-the-sub-tree-with-the-same-label/) [面试题 04.12. 求和路径](https://leetcode-cn.com/problems/paths-with-sum-lcci/) [面试题 16.19. 水域大小](https://leetcode-cn.com/problems/pond-sizes-lcci/) [面试题 17.15. 最长单词](https://leetcode-cn.com/problems/longest-word-lcci/)(与 472 相似) [面试题 17.22. 单词转换](https://leetcode-cn.com/problems/word-transformer-lcci/) [剑指 Offer 12. 矩阵中的路径](https://leetcode-cn.com/problems/ju-zhen-zhong-de-lu-jing-lcof/)(与 79 同) [剑指 Offer 13. 机器人的运动范围](https://leetcode-cn.com/problems/ji-qi-ren-de-yun-dong-fan-wei-lcof/) ### (Breadth First Search)广度优先搜索 [773. 滑动谜题](https://leetcode-cn.com/problems/sliding-puzzle/) [103. 二叉树的锯齿形层序遍历](https://leetcode-cn.com/problems/binary-tree-zigzag-level-order-traversal/) [310. 最小高度树](https://leetcode-cn.com/problems/minimum-height-trees/) [1030. 距离顺序排列矩阵单元格](https://leetcode-cn.com/problems/matrix-cells-in-distance-order/) [1091. 二进制矩阵中的最短路径](https://leetcode-cn.com/problems/shortest-path-in-binary-matrix/) [1162. 地图分析](https://leetcode-cn.com/problems/as-far-from-land-as-possible/) [1765. 地图中的最高点](https://leetcode-cn.com/problems/map-of-highest-peak/) [面试题 04.03. 特定深度节点链表](https://leetcode-cn.com/problems/list-of-depth-lcci/) [剑指 Offer 32 - I. 从上到下打印二叉树](https://leetcode-cn.com/problems/cong-shang-dao-xia-da-yin-er-cha-shu-lcof/) [剑指 Offer 32 - III. 从上到下打印二叉树 III](https://leetcode-cn.com/problems/cong-shang-dao-xia-da-yin-er-cha-shu-iii-lcof/)