README ¶ leetcode 我的 Leetcode 解题记录。 主要解题语言: Golang, Python3, TypeScript 已解 动态规划 5. 最长回文子串 45. 跳跃游戏 II 70. 爬楼梯 121. 买卖股票的最佳时机 198. 打家劫舍 213. 打家劫舍 II 746. 使用最小花费爬楼梯 2049. 统计最高分的节点数目 2104. 子数组范围和 二叉树 101. 对称二叉树 107. 二叉树的层序遍历 II 116. 填充每个节点的下一个右侧节点指针 429. N 叉树的层序遍历 652. 寻找重复的子树 653. 两数之和 IV - 输入 BST 662. 二叉树最大宽度 669. 修剪二叉搜索树 1161. 最大层内元素和 2096. 从二叉树一个节点到另一个节点每一步的方向 2196. 根据描述创建二叉树 图 39. 组合总和 79. 单词搜索 207. 课程表 827. 最大人工岛 1020. 飞地的数量 1162. 地图分析 1203. 项目管理 1706. 球会落何处 2039. 网络空闲的时刻 2101. 引爆最多的炸弹 2192. 有向无环图中一个节点的所有祖先 2359. 找到离给定两个节点最近的节点 2360. 图中的最长环 2368. 受限条件下可到达节点的数目 字符串 3. 无重复字符的最长子串 6. Z 字形变换 22. 括号生成 521. 最长特殊序列 Ⅰ 1763. 最长的美好子字符串 1897. 重新分配字符使所有字符串都相等 2024. 考试的最大困扰度 2156. 查找给定哈希值的子串 2207. 字符串中最多数目的子字符串 数组 1. 两数之和 4. 寻找两个正序数组的中位数 27. 移除元素 526. 优美的排列 540. 有序数组中的单一元素 622. 设计循环队列 646. 最长数对链 670. 最大交换 798. 得分最高的最小轮调 912. 排序数组 1109. 航班预订统计 1217. 玩筹码 1248. 统计「优美子数组」 1582. 二进制矩阵中的特殊位置 2017. 网格游戏 2044. 统计按位或能得到最大值的子集数目 2055. 蜡烛之间的盘子 2100. 适合打劫银行的日子 2171. 拿出最少数目的魔法豆 2195. 向数组中追加 K 个整数 2200. 找出数组中的所有 K 近邻下标 2201. 统计可以提取的工件 2208. 将数组和减半的最少操作次数 2379. 得到 K 个黑块的最少涂色次数 字典树 208. 实现 Trie (前缀树) 648. 单词替换 哈希表 49. 字母异位词分组 599. 两个列表的最小索引总和 974. 和可被 K 整除的子数组 2006. 差的绝对值为 K 的数对数目 2155. 分组得分最高的所有下标 2357. 使数组中所有元素都等于零 栈 20. 有效的括号 155. 最小栈 496. 下一个更大元素 I 735. 行星碰撞 946. 验证栈序列 贪心 881. 救生艇 1414. 和为 K 的最少斐波那契数字数目 2038. 如果相邻两个颜色均相同则删除当前颜色 位运算 67. 二进制求和 89. 格雷编码 136. 只出现一次的数字 190. 颠倒二进制位 393. UTF-8 编码验证 2166. 设计位集 数学 46. 全排列 69. x 的平方根 168. Excel表列名称 172. 阶乘后的零 258. 各位相加 405. 数字转换为十六进制数 504. 七进制数 507. 完美数 592. 分数加减运算 593. 有效的正方形 883. 三维形体投影面积 1288. 删除被覆盖区间 1447. 最简分数 1922. 统计好数字的数目 2178. 拆分成最多数目的偶整数之和 2191. 将杂乱无章的数字排序 2197. 替换数组中的非互质数 堆 703. 数据流中的第 K 大元素 并查集 990. 等式方程的可满足性 链表 2. 两数相加 脑筋急转弯 1460. 通过翻转子数组使两个数组相等 1689. 十-二进制数的最少数目 其他 2170. 使数组变成交替数组的最少操作数 2187. 完成旅途的最少时间 简单题 9. 回文数 54. 螺旋矩阵 58. 最后一个单词的长度 341. 扁平化嵌套列表迭代器 461. 汉明距离 537. 复数乘法 589. N 叉树的前序遍历 590. N 叉树的后序遍历 606. 根据二叉树创建字符串 658. 找到 K 个最接近的元素 661. 图片平滑器 682. 棒球比赛 693. 交替位二进制数 720. 词典中最长的单词 728. 自除数 884. 两句话中的不常见单词 917. 仅仅反转字母 1108. IP 地址无效化 1189. “气球” 的最大数量 1295. 统计位数为偶数的数字 1324. 竖直打印单词 1331. 数组序号转换 1380. 矩阵中的幸运数 1431. 拥有最多糖果的孩子 1464. 数组中两元素的最大乘积 1646. 获取生成数组中的最大值 1470. 重新排列数组 1470. 重新排列数组 1592. 重新排列单词间的空格 1598. 文件夹操作日志搜集器 1608. 特殊数组的特征值 1619. 删除某些元素后的数组均值 1624. 两个相同字符之间的最长子字符串 1636. 按照频率将数组升序排序 1668. 最大重复子字符串 1725. 可以形成最大正方形的矩形数目 1732. 找到最高海拔 1748. 唯一元素的和 1790. 仅执行一次字符串交换能否使两个字符串相等 1791. 找出星型图的中心节点 1812. 判断国际象棋棋盘中一个格子的颜色 1952. 三除数 1984. 学生分数的最小差值 1985. 找出数组中的第 K 大整数 2000. 反转单词前缀 2016. 增量元素之间的最大差值 2028. 找出缺失的观测数据 2043. 简易银行系统 2119. 反转两次的数字 2154. 将找到的值乘以 2 2160. 拆分数位后四位数字的最小和 2161. 根据给定数字划分数组 2162. 设置时间的最少代价 2164. 对奇偶下标分别排序 2165. 重排数字的最小值 2169. 得到 0 的操作数 2176. 统计数组中相等且可以被整除的数对 2177. 找到和为给定整数的三个连续整数 2180. 统计各位数字之和为偶数的整数个数 2185. 统计包含给定前缀的字符串 2186. 使两字符串互为字母异位词的最少步骤数 2190. 数组中紧跟 key 之后出现最频繁的数字 2194. Excel 表中某个范围内的单元格 2206. 将数组划分成相等数对 2303. 计算应缴税款总额 2367. 算术三元组的数目 2373. 矩阵中的局部最大值 2383. 赢得比赛需要的最少训练时长 Expand ▾ Collapse ▴ Directories ¶ Show internal Expand all Path Synopsis problems 1.two-sum 101.symmetric-tree 1020.number-of-enclaves 1108.defanging-an-ip-address 1109.corporate-flight-bookings 116.populating-next-right-pointers-in-each-node 1162.as-far-from-land-as-possible 1189.maximum-number-of-balloons 1203.sort-items-by-groups-respecting-dependencies 121.best-time-to-buy-and-sell-stock 1248.count-number-of-nice-subarrays 1295.find-numbers-with-even-number-of-digits 1324.print-words-vertically 136.single-number 1380.lucky-numbers-in-a-matrix 1447.simplified-fractions 155.min-stack 168.excel-sheet-column-title 1706.where-will-the-ball-fall 172.factorial-trailing-zeroes 1732.find-the-highest-altitude 1791.find-center-of-star-graph 1812.determine-color-of-a-chessboard-square 1897.redistribute-characters-to-make-all-strings-equal 1922.count-good-numbers 1952.three-divisors 198.house-robber 1984.minimum-difference-between-highest-and-lowest-of-k-scores 20.valid-parentheses 2006.count-number-of-pairs-with-absolute-difference-k 2016.maximum-difference-between-increasing-elements 2024.maximize-the-confusion-of-an-exam 2028.find-missing-observations 2038.remove-colored-pieces-if-both-neighbors-are-the-same-color 2039.the-time-when-the-network-becomes-idle 2043.simple-bank-system 2044.count-number-of-maximum-bitwise-or-subsets 2049.count-nodes-with-the-highest-score 2055.plates-between-candles 207.course-schedule 2096.step-by-step-directions-from-a-binary-tree-node-to-another 2100.find-good-days-to-rob-the-bank 2101.detonate-the-maximum-bombs 2104.sum-of-subarray-ranges 2119.a-number-after-a-double-reversal 213.house-robber-ii 2169.count-operations-to-obtain-zero 2170.minimum-operations-to-make-the-array-alternating 2171.removing-minimum-number-of-magic-beans 2176.count-equal-and-divisible-pairs-in-an-array 2177.find-three-consecutive-integers-that-sum-to-a-given-number 2178.maximum-split-of-positive-even-integers 2180.count-integers-with-even-digit-sum 2185.counting-words-with-a-given-prefix 2186.minimum-number-of-steps-to-make-two-strings-anagram-ii 2187.minimum-time-to-complete-trips 2190.most-frequent-number-following-key-in-an-array 2191.sort-the-jumbled-numbers 2192.all-ancestors-of-a-node-in-a-directed-acyclic-graph 2194.cells-in-a-range-on-an-excel-sheet 2195.append-k-integers-with-minimal-sum 2196.create-binary-tree-from-descriptions 2197.replace-non-coprime-numbers-in-array 22.generate-parentheses 2200.find-all-k-distant-indices-in-an-array 2201.count-artifacts-that-can-be-extracted 2206.divide-array-into-equal-pairs 2207.maximize-number-of-subsequences-in-a-string 2208.minimum-operations-to-halve-array-sum 2379.minimum-recolors-to-get-k-consecutive-black-blocks 2383.minimum-hours-of-training-to-win-a-competition 258.add-digits 27.remove-element 3.longest-substring-without-repeating-characters 39.combination-sum 393.utf-8-validation 4.median-of-two-sorted-arrays 405.convert-a-number-to-hexadecimal 45.jump-game-ii 46.permutations 461.hamming-distance 49.group-anagrams 492.n-ary-tree-level-order-traversal 496.next-greater-element-i 5.longest-palindromic-substring 504.base-7 507.perfect-number 521.longest-uncommon-subsequence-i 526.beautiful-arrangement 537.complex-number-multiplication 540.single-element-in-a-sorted-array 58.length-of-last-word 589.n-ary-tree-preorder-traversal 590.n-ary-tree-postorder-traversal 599.minimum-index-sum-of-two-lists 6.zigzag-conversion 606.construct-string-from-binary-tree 653.two-sum-iv-input-is-a-bst 661.image-smoother 67.add-binary 682.baseball-game 69.sqrtx 693.binary-number-with-alternating-bits 70.climbing-stairs 703.kth-largest-element-in-a-stream 720.longest-word-in-dictionary 728.self-dividing-numbers 735.asteroid-collision 746.min-cost-climbing-stairs 789.smallest-rotation-with-highest-score 79.word-search 883.projection-area-of-3d-shapes 9.palindrome-number 912.sort-an-array 917.reverse-only-letters 974.subarray-sums-divisible-by-k 990.satisfiability-of-equality-equations Click to show internal directories. Click to hide internal directories.