From 474e31f66141ce8f9d396814ef6f6bcbb5e8da86 Mon Sep 17 00:00:00 2001 From: AC_Oier Date: Tue, 1 Jun 2021 10:08:03 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8feat:=20Update=20LeetCode=20146?= =?UTF-8?q?=E3=80=811744=E3=80=81231=E3=80=81342=E3=80=81477?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Index/BFS.md | 10 +- Index/DFS.md | 14 +- "Index/344円272円214円345円210円206円.md" | 22 +-- .../344円275円215円350円277円220円347円256円227円.md" | 7 +- .../345円211円215円347円274円200円345円222円214円.md" | 14 +- .../345円215円225円350円260円203円346円240円210円.md" | 2 +- .../345円217円214円346円214円207円351円222円210円.md" | 12 +- .../345円223円210円345円270円214円350円241円250円.md" | 18 +- ...17347円224円237円346円210円220円346円240円221円.md" | 2 +- "Index/345円240円206円.md" | 2 +- .../345円271円266円346円237円245円351円233円206円.md" | 4 +- "Index/345円272円217円345円210円227円 DP.md" | 6 +- ...53346円205円242円346円214円207円351円222円210円.md" | 4 - "Index/346円225円260円345円255円246円.md" | 17 +- "Index/346円240円210円.md" | 6 +- ...21347円212円266円346円225円260円347円273円204円.md" | 4 +- ...21347円232円204円346円220円234円347円264円242円.md" | 10 +- "Index/346円250円241円346円213円237円.md" | 22 +-- ...21345円212円250円347円252円227円345円217円243円.md" | 12 +- ...03347円264円240円351円227円256円351円242円230円.md" | 0 "Index/347円272円277円346円200円247円 DP.md" | 12 +- "Index/350円203円214円345円214円205円 DP.md" | 1 - ...41347円256円227円351円227円256円351円242円230円.md" | 4 +- ...06345円214円226円346円220円234円347円264円242円.md" | 2 +- ...52345円277円203円347円256円227円346円263円225円.md" | 6 +- "Index/351円223円276円350円241円250円.md" | 1 + "Index/351円230円237円345円210円227円.md" | 2 +- ...10344円270円255円347円255円211円357円274円211円.md" | 2 +- ...10345円233円260円351円232円276円357円274円211円.md" | 152 ++++++++++++++++ ...10344円270円255円347円255円211円357円274円211円.md" | 171 +++++++++++++++++ ...10344円270円255円347円255円211円357円274円211円.md" | 108 +++++++++++ ...10344円270円255円347円255円211円357円274円211円.md" | 4 +- ...10345円233円260円351円232円276円357円274円211円.md" | 2 +- ...10347円256円200円345円215円225円357円274円211円.md" | 99 ++++++++++ ...10347円256円200円345円215円225円357円274円211円.md" | 101 ++++++++++ ...10344円270円255円347円255円211円357円274円211円.md" | 87 +++++++++ ...10344円270円255円347円255円211円357円274円211円.md" | 172 ++++++++++++++++++ 37 files changed, 1005 insertions(+), 109 deletions(-) delete mode 100644 "Index/345円277円253円346円205円242円346円214円207円351円222円210円.md" rename "Index/346円225円260円347円273円204円347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" => "Index/347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" (100%) create mode 100644 "LeetCode/1171-1180/1074. 345円205円203円347円264円240円345円222円214円344円270円272円347円233円256円346円240円207円345円200円274円347円232円204円345円255円220円347円237円251円351円230円265円346円225円260円351円207円217円357円274円210円345円233円260円351円232円276円357円274円211円.md" create mode 100644 "LeetCode/141-150/146. LRU 347円274円223円345円255円230円346円234円272円345円210円266円357円274円210円344円270円255円347円255円211円357円274円211円.md" create mode 100644 "LeetCode/1741-1750/1744. 344円275円240円350円203円275円345円234円250円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円351円202円243円345円244円251円345円220円203円345円210円260円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円347円263円226円346円236円234円345円220円227円357円274円237円357円274円210円344円270円255円347円255円211円357円274円211円.md" create mode 100644 "LeetCode/231-240/231. 2 347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" create mode 100644 "LeetCode/341-350/342. 4347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" create mode 100644 "LeetCode/471-480/477. 346円261円211円346円230円216円350円267円235円347円246円273円346円200円273円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" create mode 100644 "LeetCode/351円235円242円350円257円225円351円242円230円/351円235円242円350円257円225円351円242円230円 16.25. LRU 347円274円223円345円255円230円357円274円210円344円270円255円347円255円211円357円274円211円.md" diff --git a/Index/BFS.md b/Index/BFS.md index 04024755..d32932be 100644 --- a/Index/BFS.md +++ b/Index/BFS.md @@ -1,10 +1,10 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | -| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | -| [690. 员工的重要性](https://leetcode-cn.com/problems/employee-importance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/employee-importance/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-s79x/) | 简单 | 🤩🤩🤩 | +| [90. 子集 II](https://leetcode-cn.com/problems/subsets-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subsets-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hui-s-g77q/) | 中等 | 🤩🤩🤩🤩 | | [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩🤩 | -| [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-of-bst/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-q2fo/) | 简单 | 🤩🤩🤩 | +| [690. 员工的重要性](https://leetcode-cn.com/problems/employee-importance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/employee-importance/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-s79x/) | 简单 | 🤩🤩🤩 | +| [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | | [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/solution/gong-shui-san-xie-yi-ti-san-jie-shu-de-s-7r17/) | 简单 | 🤩🤩🤩 | -| [90. 子集 II](https://leetcode-cn.com/problems/subsets-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subsets-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hui-s-g77q/) | 中等 | 🤩🤩🤩🤩 | +| [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-of-bst/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-q2fo/) | 简单 | 🤩🤩🤩 | +| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | diff --git a/Index/DFS.md b/Index/DFS.md index 8feb499f..40a22cc6 100644 --- a/Index/DFS.md +++ b/Index/DFS.md @@ -5,15 +5,15 @@ | [37. 解数独](https://leetcode-cn.com/problems/sudoku-solver/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sudoku-solver/solution/he-n-huang-hou-yi-yang-shi-yi-dao-hui-su-lfpd/) | 困难 | 🤩🤩🤩🤩 | | [39. 组合总和](https://leetcode-cn.com/problems/combination-sum/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum/solution/dfs-hui-su-suan-fa-yi-ji-ru-he-que-ding-wpbo5/) | 中等 | 🤩🤩🤩🤩 | | [40. 组合总和 II](https://leetcode-cn.com/problems/combination-sum-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/combination-sum-ii/solution/dfs-hui-su-jie-fa-yi-ji-ru-he-pan-duan-s-xlwy/) | 中等 | 🤩🤩🤩🤩 | +| [301. 删除无效的括号](https://leetcode-cn.com/problems/remove-invalid-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-invalid-parentheses/solution/yi-fen-zhong-nei-kan-dong-jiang-gua-hao-aya6k/) | 困难 | 🤩🤩🤩🤩 | +| [341. 扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flatten-nested-list-iterator/solution/yi-ti-shuang-jie-dfsdui-lie-di-gui-zhan-kvwhy/) | 中等 | 🤩🤩🤩 | +| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩🤩 | +| [690. 员工的重要性](https://leetcode-cn.com/problems/employee-importance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/employee-importance/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-s79x/) | 简单 | 🤩🤩🤩 | | [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | -| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | +| [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/solution/gong-shui-san-xie-yi-ti-san-jie-shu-de-s-7r17/) | 简单 | 🤩🤩🤩 | | [872. 叶子相似的树](https://leetcode-cn.com/problems/leaf-similar-trees/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/leaf-similar-trees/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-udfc/) | 简单 | 🤩🤩🤩 | -| [1723. 完成所有工作的最短时间](https://leetcode-cn.com/problems/find-minimum-time-to-finish-all-jobs/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-time-to-finish-all-jobs/solution/gong-shui-san-xie-yi-ti-shuang-jie-jian-4epdd/) | 困难 | 🤩🤩🤩 | -| [690. 员工的重要性](https://leetcode-cn.com/problems/employee-importance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/employee-importance/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-s79x/) | 简单 | 🤩🤩🤩 | -| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩🤩 | | [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-of-bst/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-q2fo/) | 简单 | 🤩🤩🤩 | -| [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/solution/gong-shui-san-xie-yi-ti-san-jie-shu-de-s-7r17/) | 简单 | 🤩🤩🤩 | -| [341. 扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flatten-nested-list-iterator/solution/yi-ti-shuang-jie-dfsdui-lie-di-gui-zhan-kvwhy/) | 中等 | 🤩🤩🤩 | -| [301. 删除无效的括号](https://leetcode-cn.com/problems/remove-invalid-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-invalid-parentheses/solution/yi-fen-zhong-nei-kan-dong-jiang-gua-hao-aya6k/) | 困难 | 🤩🤩🤩🤩 | +| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | +| [1723. 完成所有工作的最短时间](https://leetcode-cn.com/problems/find-minimum-time-to-finish-all-jobs/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-time-to-finish-all-jobs/solution/gong-shui-san-xie-yi-ti-shuang-jie-jian-4epdd/) | 困难 | 🤩🤩🤩 | | [1766. 互质树](https://leetcode-cn.com/problems/tree-of-coprimes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/tree-of-coprimes/solution/bu-tai-yi-yang-de-dfs-ji-lu-suo-you-zui-d3xeu/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/344円272円214円345円210円206円.md" "b/Index/344円272円214円345円210円206円.md" index 0bbb78c4..608cf95e 100644 --- "a/Index/344円272円214円345円210円206円.md" +++ "b/Index/344円272円214円345円210円206円.md" @@ -5,19 +5,19 @@ | [33. 搜索旋转排序数组](https://leetcode-cn.com/problems/search-in-rotated-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-in-rotated-sorted-array/solution/shua-chuan-lc-yan-ge-ologn100yi-qi-kan-q-xifo/) | 中等 | 🤩🤩🤩🤩🤩 | | [34. 在排序数组中查找元素的第一个和最后一个位置](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-first-and-last-position-of-element-in-sorted-array/solution/sha-sha-gao-bu-qing-ru-he-ding-yi-er-fen-rrj1/) | 中等 | 🤩🤩🤩🤩🤩 | | [35. 搜索插入位置](https://leetcode-cn.com/problems/search-insert-position/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-insert-position/solution/shua-chuan-lc-jian-dan-mo-ni-ti-by-ac_oi-7d5t/) | 简单 | 🤩🤩🤩🤩🤩 | +| [74. 搜索二维矩阵](https://leetcode-cn.com/problems/search-a-2d-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-a-2d-matrix/solution/gong-shui-san-xie-yi-ti-shuang-jie-er-fe-l0pq/) | 中等 | 🤩🤩🤩🤩 | +| [81. 搜索旋转排序数组 II](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/solution/gong-shui-san-xie-xiang-jie-wei-he-yuan-xtam4//) | 中等 | 🤩🤩🤩🤩 | +| [153. 寻找旋转排序数组中的最小值](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/solution/gong-shui-san-xie-yan-ge-olognyi-qi-kan-6d969/) | 中等 | 🤩🤩🤩 | +| [154. 寻找旋转排序数组中的最小值 II](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/solution/gong-shui-san-xie-xiang-jie-wei-he-yuan-7xbty/) | 困难 | 🤩🤩🤩 | +| [220. 存在重复元素 III](https://leetcode-cn.com/problems/contains-duplicate-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/contains-duplicate-iii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hua-d-dlnv/) | 中等 | 🤩🤩🤩 | +| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩 | +| [363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) | 困难 | 🤩🤩🤩 | | [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | +| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | +| [1011. 在 D 天内送达包裹的能力](https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/solution/gong-shui-san-xie-li-yong-er-duan-xing-z-95zj/) | 中等 | 🤩🤩🤩🤩 | | [1208. 尽可能使字符串相等](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/solution/ni-bu-ke-neng-kan-bu-dong-de-qian-zhui-h-u4l1/) | 中等 | 🤩🤩🤩 | -| [1751. 最多可以参加的会议数目 II](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/solution/po-su-dp-er-fen-dp-jie-fa-by-ac_oier-88du/) | 困难 | 🤩🤩🤩 | +| [1438. 绝对差不超过限制的最长连续子数组](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/solution/xiang-jie-er-fen-hua-dong-chuang-kou-dan-41g1/) | 中等 | 🤩🤩🤩 | | [1482. 制作 m 束花所需的最少天数](https://leetcode-cn.com/problems/minimum-number-of-days-to-make-m-bouquets/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-number-of-days-to-make-m-bouquets/solution/gong-shui-san-xie-li-yong-er-duan-xing-z-ysv4/) | 中等 | 🤩🤩🤩 | -| [1011. 在 D 天内送达包裹的能力](https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days/solution/gong-shui-san-xie-li-yong-er-duan-xing-z-95zj/) | 中等 | 🤩🤩🤩🤩 | -| [363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) | 困难 | 🤩🤩🤩 | -| [220. 存在重复元素 III](https://leetcode-cn.com/problems/contains-duplicate-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/contains-duplicate-iii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hua-d-dlnv/) | 中等 | 🤩🤩🤩 | -| [154. 寻找旋转排序数组中的最小值 II](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array-ii/solution/gong-shui-san-xie-xiang-jie-wei-he-yuan-7xbty/) | 困难 | 🤩🤩🤩 | | [1707. 与数组中元素的最大异或值](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/solution/gong-shui-san-xie-jie-zhe-ge-wen-ti-lai-lypqr/) | 困难 | 🤩🤩🤩 | -| [153. 寻找旋转排序数组中的最小值](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-minimum-in-rotated-sorted-array/solution/gong-shui-san-xie-yan-ge-olognyi-qi-kan-6d969/) | 中等 | 🤩🤩🤩 | -| [81. 搜索旋转排序数组 II](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-in-rotated-sorted-array-ii/solution/gong-shui-san-xie-xiang-jie-wei-he-yuan-xtam4//) | 中等 | 🤩🤩🤩🤩 | -| [74. 搜索二维矩阵](https://leetcode-cn.com/problems/search-a-2d-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-a-2d-matrix/solution/gong-shui-san-xie-yi-ti-shuang-jie-er-fe-l0pq/) | 中等 | 🤩🤩🤩🤩 | -| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩 | -| [1438. 绝对差不超过限制的最长连续子数组](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/solution/xiang-jie-er-fen-hua-dong-chuang-kou-dan-41g1/) | 中等 | 🤩🤩🤩 | -| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | +| [1751. 最多可以参加的会议数目 II](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/solution/po-su-dp-er-fen-dp-jie-fa-by-ac_oier-88du/) | 困难 | 🤩🤩🤩 | diff --git "a/Index/344円275円215円350円277円220円347円256円227円.md" "b/Index/344円275円215円350円277円220円347円256円227円.md" index b48b3024..7617acb8 100644 --- "a/Index/344円275円215円350円277円220円347円256円227円.md" +++ "b/Index/344円275円215円350円277円220円347円256円227円.md" @@ -1,10 +1,13 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [137. 只出现一次的数字 II](https://leetcode-cn.com/problems/single-number-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/single-number-ii/solution/gong-shui-san-xie-yi-ti-san-jie-ha-xi-bi-fku8/) | 中等 | 🤩🤩🤩 | | [90. 子集 II](https://leetcode-cn.com/problems/subsets-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subsets-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hui-s-g77q/) | 中等 | 🤩🤩🤩🤩 | +| [137. 只出现一次的数字 II](https://leetcode-cn.com/problems/single-number-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/single-number-ii/solution/gong-shui-san-xie-yi-ti-san-jie-ha-xi-bi-fku8/) | 中等 | 🤩🤩🤩 | | [190. 颠倒二进制位](https://leetcode-cn.com/problems/reverse-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-bits/solution/yi-ti-san-jie-dui-cheng-wei-zhu-wei-fen-ub1hi/) | 简单 | 🤩🤩🤩 | | [191. 位1的个数](https://leetcode-cn.com/problems/number-of-1-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/number-of-1-bits/solution/yi-ti-san-jie-wei-shu-jian-cha-you-yi-to-av1r/) | 简单 | 🤩🤩🤩 | -| [461. 汉明距离](https://leetcode-cn.com/problems/hamming-distance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/hamming-distance/solution/gong-shui-san-xie-tong-ji-liang-shu-er-j-987a/) | 简单 | 🤩🤩🤩🤩 | +| [231. 2 的幂](https://leetcode-cn.com/problems/power-of-two/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/power-of-two/solution/gong-shui-san-xie-2-de-mi-by-ac_oier-qm6e/) | 简单 | 🤩🤩🤩 | | [338. 比特位计数](https://leetcode-cn.com/problems/counting-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/counting-bits/solution/po-su-jie-fa-dong-tai-gui-hua-jie-fa-by-vvail/) | 简单 | 🤩🤩🤩 | +| [342. 4的幂](https://leetcode-cn.com/problems/power-of-four/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/power-of-four/solution/gong-shui-san-xie-zhuan-hua-wei-2-de-mi-y21lq/) | 简单 | 🤩🤩🤩 | +| [461. 汉明距离](https://leetcode-cn.com/problems/hamming-distance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/hamming-distance/solution/gong-shui-san-xie-tong-ji-liang-shu-er-j-987a/) | 简单 | 🤩🤩🤩🤩 | +| [477. 汉明距离总和](https://leetcode-cn.com/problems/total-hamming-distance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/total-hamming-distance/solution/gong-shui-san-xie-ying-yong-cheng-fa-yua-g21t/) | 简单 | 🤩🤩🤩🤩 | | [1178. 猜字谜](https://leetcode-cn.com/problems/number-of-valid-words-for-each-puzzle/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/number-of-valid-words-for-each-puzzle/solution/xiang-jin-zhu-shi-xiang-jie-po-su-wei-yu-3cr2/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/345円211円215円347円274円200円345円222円214円.md" "b/Index/345円211円215円347円274円200円345円222円214円.md" index 75665473..b4d83258 100644 --- "a/Index/345円211円215円347円274円200円345円222円214円.md" +++ "b/Index/345円211円215円347円274円200円345円222円214円.md" @@ -1,13 +1,15 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | +| [304. 二维区域和检索 - 矩阵不可变](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/solution/xia-ci-ru-he-zai-30-miao-nei-zuo-chu-lai-ptlo/) | 中等 | 🤩🤩🤩🤩🤩 | +| [303. 区域和检索 - 数组不可变](https://leetcode-cn.com/problems/range-sum-query-immutable/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-query-immutable/solution/sha-shi-qian-zhui-he-ya-tu-jie-qian-zhui-0rla/) | 简单 | 🤩🤩🤩🤩🤩 | +| [363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) | 困难 | 🤩🤩🤩 | | [724. 寻找数组的中心下标](https://leetcode-cn.com/problems/find-pivot-index/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-pivot-index/solution/shi-yong-shao-bing-ji-qiao-liang-bian-qi-vkju/) | 简单 | 🤩🤩🤩🤩🤩 | +| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | +| [1074. 元素和为目标值的子矩阵数量](https://leetcode-cn.com/problems/number-of-submatrices-that-sum-to-target/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/number-of-submatrices-that-sum-to-target/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-uttw/) | 困难 | 🤩🤩🤩 | | [1208. 尽可能使字符串相等](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/solution/ni-bu-ke-neng-kan-bu-dong-de-qian-zhui-h-u4l1/) | 中等 | 🤩🤩🤩 | -| [1749. 任意子数组和的绝对值的最大值](https://leetcode-cn.com/problems/maximum-absolute-sum-of-any-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-absolute-sum-of-any-subarray/solution/xiang-jie-qian-zhui-he-jie-fa-fen-xi-si-yibby/) | 中等 | 🤩🤩🤩 | +| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | | [1442. 形成两个异或相等数组的三元组数目](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/solution/gong-shui-san-xie-xiang-jie-shi-yong-qia-7gzm/) | 中等 | 🤩🤩🤩 | | [1738. 找出第 K 大的异或坐标值](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/solution/gong-shui-san-xie-xiang-jie-li-yong-er-w-ai0d/) | 中等 | 🤩🤩🤩 | -| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | -| [363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) | 困难 | 🤩🤩🤩 | -| [304. 二维区域和检索 - 矩阵不可变](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/solution/xia-ci-ru-he-zai-30-miao-nei-zuo-chu-lai-ptlo/) | 中等 | 🤩🤩🤩🤩🤩 | -| [303. 区域和检索 - 数组不可变](https://leetcode-cn.com/problems/range-sum-query-immutable/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-query-immutable/solution/sha-shi-qian-zhui-he-ya-tu-jie-qian-zhui-0rla/) | 简单 | 🤩🤩🤩🤩🤩 | -| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | +| [1744. 你能在你最喜欢的那天吃到你最喜欢的糖果吗?](https://leetcode-cn.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day/solution/gong-shui-san-xie-qian-zhui-he-qiu-jie-c-b38y/) | 中等 | 🤩🤩🤩🤩🤩 | +| [1749. 任意子数组和的绝对值的最大值](https://leetcode-cn.com/problems/maximum-absolute-sum-of-any-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-absolute-sum-of-any-subarray/solution/xiang-jie-qian-zhui-he-jie-fa-fen-xi-si-yibby/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/345円215円225円350円260円203円346円240円210円.md" "b/Index/345円215円225円350円260円203円346円240円210円.md" index b85bd11e..8d30088f 100644 --- "a/Index/345円215円225円350円260円203円346円240円210円.md" +++ "b/Index/345円215円225円350円260円203円346円240円210円.md" @@ -1,6 +1,6 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | | [42. 接雨水](https://leetcode-cn.com/problems/trapping-rain-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/trapping-rain-water/solution/po-su-jie-fa-on2-cha-zhao-you-hua-on-dan-iu44/) | 困难 | 🤩🤩🤩🤩 | -| [456. 132 模式](https://leetcode-cn.com/problems/132-pattern/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/132-pattern/solution/xiang-xin-ke-xue-xi-lie-xiang-jie-wei-he-95gt/) | 中等 | 🤩🤩🤩 | | [503. 下一个更大元素 II](https://leetcode-cn.com/problems/next-greater-element-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/next-greater-element-ii/solution/cong-po-su-jie-fa-de-jiao-du-qu-li-jie-d-trht/) | 中等 | 🤩🤩🤩 | +| [456. 132 模式](https://leetcode-cn.com/problems/132-pattern/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/132-pattern/solution/xiang-xin-ke-xue-xi-lie-xiang-jie-wei-he-95gt/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/345円217円214円346円214円207円351円222円210円.md" "b/Index/345円217円214円346円214円207円351円222円210円.md" index e8092494..2b304067 100644 --- "a/Index/345円217円214円346円214円207円351円222円210円.md" +++ "b/Index/345円217円214円346円214円207円351円222円210円.md" @@ -8,15 +8,15 @@ | [19. 删除链表的倒数第 N 个结点](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/solution/shua-chuan-lc-lian-biao-kuai-man-zhi-zhe-1gs1/) | 中等 | 🤩🤩🤩🤩🤩 | | [26. 删除有序数组中的重复项](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/solution/shua-chuan-lc-jian-ji-shuang-zhi-zhen-ji-2eg8) | 简单 | 🤩🤩🤩🤩 | | [27. 移除元素](https://leetcode-cn.com/problems/remove-element/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-element/solution/shua-chuan-lc-shuang-bai-shuang-zhi-zhen-mzt8/) | 简单 | 🤩🤩🤩🤩 | -| [424. 替换后的最长重复字符](https://leetcode-cn.com/problems/longest-repeating-character-replacement/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-repeating-character-replacement/solution/ping-ping-wu-qi-shuang-zhi-zhen-da-bai-h-fgif/) | 中等 | 🤩🤩🤩🤩 | | [45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/jump-game-ii/solution/xiang-jie-dp-tan-xin-shuang-zhi-zhen-jie-roh4/) | 中等 | 🤩🤩🤩🤩 | -| [633. 平方数之和](https://leetcode-cn.com/problems/sum-of-square-numbers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-square-numbers/solution/gong-shui-san-xie-yi-ti-san-jie-mei-ju-s-7qi5/) | 简单 | 🤩🤩 | | [88. 合并两个有序数组](https://leetcode-cn.com/problems/merge-sorted-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/merge-sorted-array/solution/gong-shui-san-xie-yi-ti-san-jie-shuang-z-47gj/) | 简单 | 🤩🤩🤩 | | [395. 至少有 K 个重复字符的最长子串](https://leetcode-cn.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-substring-with-at-least-k-repeating-characters/solution/xiang-jie-mei-ju-shuang-zhi-zhen-jie-fa-50ri1/) | 中等 | 🤩🤩🤩 | -| [832. 翻转图像](https://leetcode-cn.com/problems/flipping-an-image/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flipping-an-image/solution/shuang-zhi-zhen-yi-bian-chu-li-huan-you-ik0v1/) | 简单 | 🤩🤩 | +| [424. 替换后的最长重复字符](https://leetcode-cn.com/problems/longest-repeating-character-replacement/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-repeating-character-replacement/solution/ping-ping-wu-qi-shuang-zhi-zhen-da-bai-h-fgif/) | 中等 | 🤩🤩🤩🤩 | +| [485. 最大连续 1 的个数](https://leetcode-cn.com/problems/max-consecutive-ones/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones/solution/you-shi-yi-tian-gao-pin-jian-dan-ti-ni-d-avj1/) | 简单 | 🤩🤩🤩🤩 | +| [633. 平方数之和](https://leetcode-cn.com/problems/sum-of-square-numbers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-square-numbers/solution/gong-shui-san-xie-yi-ti-san-jie-mei-ju-s-7qi5/) | 简单 | 🤩🤩 | +| [832. 翻转图像](https://leetcode-cn.com/problems/flipping-an-image/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flipping-an-image/solution/shuang-zhi-zhen-yi-bian-chu-li-huan-you-ik0v1/) | 简单 | 🤩🤩 | +| [992. K 个不同整数的子数组](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/solution/miao-dong-xi-lie-xiang-jie-shuang-zhi-zh-9k8w/) | 困难 | 🤩🤩🤩🤩 | +| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | | [1052. 爱生气的书店老板](https://leetcode-cn.com/problems/grumpy-bookstore-owner/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/grumpy-bookstore-owner/solution/hua-dong-chuang-kou-luo-ti-by-ac_oier-nunu/) | 中等 | 🤩🤩🤩 | | [1764. 通过连接另一个数组的子数组得到一个数组](https://leetcode-cn.com/problems/form-array-by-concatenating-subarrays-of-another-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/form-array-by-concatenating-subarrays-of-another-array/solution/clean-solutionni-jue-dui-neng-kan-dong-d-l4ts/) | 中等 | 🤩🤩🤩🤩 | -| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | -| [485. 最大连续 1 的个数](https://leetcode-cn.com/problems/max-consecutive-ones/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones/solution/you-shi-yi-tian-gao-pin-jian-dan-ti-ni-d-avj1/) | 简单 | 🤩🤩🤩🤩 | -| [992. K 个不同整数的子数组](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/solution/miao-dong-xi-lie-xiang-jie-shuang-zhi-zh-9k8w/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/345円223円210円345円270円214円350円241円250円.md" "b/Index/345円223円210円345円270円214円350円241円250円.md" index 82447ed3..b90ebd7f 100644 --- "a/Index/345円223円210円345円270円214円350円241円250円.md" +++ "b/Index/345円223円210円345円270円214円350円241円250円.md" @@ -6,15 +6,17 @@ | [13. 罗马数字转整数](https://leetcode-cn.com/problems/roman-to-integer/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/roman-to-integer/solution/shua-chuan-lc-ha-xi-biao-by-ac_oier-mooy/) | 简单 | 🤩🤩 | | [30. 串联所有单词的子串](https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/solution/shua-chuan-lc-po-su-ha-xi-biao-jie-fa-hu-ml3x/) | 困难 | 🤩🤩 | | [36. 有效的数独](https://leetcode-cn.com/problems/valid-sudoku/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/valid-sudoku/solution/ha-xi-biao-jie-fa-shu-zu-jie-fa-by-ac_oi-feac/) | 中等 | 🤩🤩🤩🤩 | -| [888. 公平的糖果棒交换](https://leetcode-cn.com/problems/fair-candy-swap/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/fair-candy-swap/solution/gong-shui-san-xie-yi-ti-shuang-jie-po-su-uant/) | 简单 | 🤩🤩 | -| [1748. 唯一元素的和](https://leetcode-cn.com/problems/sum-of-unique-elements/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-unique-elements/solution/mo-ni-ti-po-su-jie-fa-by-ac_oier-ff69/) | 简单 | 🤩🤩 | -| [1442. 形成两个异或相等数组的三元组数目](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/solution/gong-shui-san-xie-xiang-jie-shi-yong-qia-7gzm/) | 中等 | 🤩🤩 | -| [692. 前K个高频单词](https://leetcode-cn.com/problems/top-k-frequent-words/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/top-k-frequent-words/solution/gong-shui-san-xie-xiang-jie-shi-yong-ha-8dxt2/) | 中等 | 🤩🤩🤩 | -| [554. 砖墙](https://leetcode-cn.com/problems/brick-wall/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/brick-wall/solution/gong-shui-san-xie-zheng-nan-ze-fan-shi-y-gsri/) | 中等 | 🤩🤩🤩 | | [137. 只出现一次的数字 II](https://leetcode-cn.com/problems/single-number-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/single-number-ii/solution/gong-shui-san-xie-yi-ti-san-jie-ha-xi-bi-fku8/) | 中等 | 🤩🤩🤩 | -| [1603. 设计停车系统](https://leetcode-cn.com/problems/design-parking-system/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-parking-system/solution/yi-ti-san-jie-jian-dan-bian-liang-ha-xi-0gs72/) | 简单 | 🤩🤩 | -| [706. 设计哈希映射](https://leetcode-cn.com/problems/design-hashmap/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-hashmap/solution/yi-ti-shuang-jie-jian-dan-shu-zu-lian-bi-yhiw/) | 简单 | 🤩🤩🤩🤩 | +| [146. LRU 缓存机制](https://leetcode-cn.com/problems/lru-cache/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/lru-cache/solution/gong-shui-san-xie-she-ji-shu-ju-jie-gou-68hv2/) | 中等 | 🤩🤩🤩🤩🤩 | +| [554. 砖墙](https://leetcode-cn.com/problems/brick-wall/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/brick-wall/solution/gong-shui-san-xie-zheng-nan-ze-fan-shi-y-gsri/) | 中等 | 🤩🤩🤩 | +| [692. 前K个高频单词](https://leetcode-cn.com/problems/top-k-frequent-words/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/top-k-frequent-words/solution/gong-shui-san-xie-xiang-jie-shi-yong-ha-8dxt2/) | 中等 | 🤩🤩🤩 | +| [697. 数组的度](https://leetcode-cn.com/problems/degree-of-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/degree-of-an-array/solution/shu-zu-ji-shu-ha-xi-biao-ji-shu-jie-fa-y-a0mg/) | 简单 | 🤩🤩🤩 | | [705. 设计哈希集合](https://leetcode-cn.com/problems/design-hashset/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-hashset/solution/yi-ti-san-jie-jian-dan-shu-zu-lian-biao-nj3dg/) | 简单 | 🤩🤩🤩🤩 | +| [706. 设计哈希映射](https://leetcode-cn.com/problems/design-hashmap/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-hashmap/solution/yi-ti-shuang-jie-jian-dan-shu-zu-lian-bi-yhiw/) | 简单 | 🤩🤩🤩🤩 | +| [888. 公平的糖果棒交换](https://leetcode-cn.com/problems/fair-candy-swap/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/fair-candy-swap/solution/gong-shui-san-xie-yi-ti-shuang-jie-po-su-uant/) | 简单 | 🤩🤩 | +| [1074. 元素和为目标值的子矩阵数量](https://leetcode-cn.com/problems/number-of-submatrices-that-sum-to-target/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/number-of-submatrices-that-sum-to-target/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-uttw/) | 困难 | 🤩🤩🤩 | | [1178. 猜字谜](https://leetcode-cn.com/problems/number-of-valid-words-for-each-puzzle/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/number-of-valid-words-for-each-puzzle/solution/xiang-jin-zhu-shi-xiang-jie-po-su-wei-yu-3cr2/) | 困难 | 🤩🤩🤩🤩 | -| [697. 数组的度](https://leetcode-cn.com/problems/degree-of-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/degree-of-an-array/solution/shu-zu-ji-shu-ha-xi-biao-ji-shu-jie-fa-y-a0mg/) | 简单 | 🤩🤩🤩 | +| [1442. 形成两个异或相等数组的三元组数目](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/solution/gong-shui-san-xie-xiang-jie-shi-yong-qia-7gzm/) | 中等 | 🤩🤩 | +| [1603. 设计停车系统](https://leetcode-cn.com/problems/design-parking-system/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/design-parking-system/solution/yi-ti-san-jie-jian-dan-bian-liang-ha-xi-0gs72/) | 简单 | 🤩🤩 | +| [1748. 唯一元素的和](https://leetcode-cn.com/problems/sum-of-unique-elements/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-unique-elements/solution/mo-ni-ti-po-su-jie-fa-by-ac_oier-ff69/) | 简单 | 🤩🤩 | diff --git "a/Index/345円233円276円350円256円272円357円274円232円346円234円200円345円260円217円347円224円237円346円210円220円346円240円221円.md" "b/Index/345円233円276円350円256円272円357円274円232円346円234円200円345円260円217円347円224円237円346円210円220円346円240円221円.md" index c02979ba..c74a9d1a 100644 --- "a/Index/345円233円276円350円256円272円357円274円232円346円234円200円345円260円217円347円224円237円346円210円220円346円240円221円.md" +++ "b/Index/345円233円276円350円256円272円357円274円232円346円234円200円345円260円217円347円224円237円346円210円220円346円240円221円.md" @@ -1,5 +1,5 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [1631. 最小体力消耗路径](https://leetcode-cn.com/problems/path-with-minimum-effort/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/path-with-minimum-effort/solution/fan-zheng-fa-zheng-ming-si-lu-de-he-fa-x-ohby/) | 中等 | 🤩🤩🤩 | | [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | +| [1631. 最小体力消耗路径](https://leetcode-cn.com/problems/path-with-minimum-effort/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/path-with-minimum-effort/solution/fan-zheng-fa-zheng-ming-si-lu-de-he-fa-x-ohby/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/345円240円206円.md" "b/Index/345円240円206円.md" index 80ab2e4a..dc7197f5 100644 --- "a/Index/345円240円206円.md" +++ "b/Index/345円240円206円.md" @@ -1,8 +1,8 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | | [23. 合并K个升序链表](https://leetcode-cn.com/problems/merge-k-sorted-lists/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/merge-k-sorted-lists/solution/shua-chuan-lc-you-xian-dui-lie-jie-fa-sh-3flb/) | 困难 | 🤩🤩🤩 | +| [264. 丑数 II](https://leetcode-cn.com/problems/ugly-number-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-you-x-3nvs/) | 中等 | 🤩🤩🤩 | | [480. 滑动窗口中位数](https://leetcode-cn.com/problems/sliding-window-median/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sliding-window-median/solution/xiang-jie-po-su-jie-fa-you-xian-dui-lie-mo397/) | 困难 | 🤩🤩🤩🤩 | | [692. 前K个高频单词](https://leetcode-cn.com/problems/top-k-frequent-words/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/top-k-frequent-words/solution/gong-shui-san-xie-xiang-jie-shi-yong-ha-8dxt2/) | 中等 | 🤩🤩🤩🤩 | -| [264. 丑数 II](https://leetcode-cn.com/problems/ugly-number-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number-ii/solution/gong-shui-san-xie-yi-ti-shuang-jie-you-x-3nvs/) | 中等 | 🤩🤩🤩 | | [703. 数据流中的第 K 大元素](https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/kth-largest-element-in-a-stream/solution/jian-da-ti-de-duo-chong-jie-fa-mou-pao-p-d1qi/) | 简单 | 🤩🤩🤩 | diff --git "a/Index/345円271円266円346円237円245円351円233円206円.md" "b/Index/345円271円266円346円237円245円351円233円206円.md" index 1fed98f1..fcfc1fcf 100644 --- "a/Index/345円271円266円346円237円245円351円233円206円.md" +++ "b/Index/345円271円266円346円237円245円351円233円206円.md" @@ -1,6 +1,6 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [1631. 最小体力消耗路径](https://leetcode-cn.com/problems/path-with-minimum-effort/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/path-with-minimum-effort/solution/fan-zheng-fa-zheng-ming-si-lu-de-he-fa-x-ohby/) | 中等 | 🤩🤩🤩 | -| [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | | [765. 情侣牵手](https://leetcode-cn.com/problems/couples-holding-hands/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/couples-holding-hands/solution/liang-chong-100-de-jie-fa-bing-cha-ji-ta-26a6/) | 困难 | 🤩🤩🤩 | +| [778. 水位上升的泳池中游泳](https://leetcode-cn.com/problems/swim-in-rising-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/swim-in-rising-water/solution/gong-shui-san-xie-yi-ti-shuang-jie-krusk-7c6o/) | 困难 | 🤩🤩🤩 | +| [1631. 最小体力消耗路径](https://leetcode-cn.com/problems/path-with-minimum-effort/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/path-with-minimum-effort/solution/fan-zheng-fa-zheng-ming-si-lu-de-he-fa-x-ohby/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/345円272円217円345円210円227円 DP.md" "b/Index/345円272円217円345円210円227円 DP.md" index b9b0579c..44347ee7 100644 --- "a/Index/345円272円217円345円210円227円 DP.md" +++ "b/Index/345円272円217円345円210円227円 DP.md" @@ -1,9 +1,9 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [740. 删除并获得点数](https://leetcode-cn.com/problems/delete-and-earn/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/delete-and-earn/solution/gong-shui-san-xie-zhuan-huan-wei-xu-lie-6c9t0/) | 中等 | 🤩🤩🤩🤩🤩 | +| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩🤩🤩 | | [368. 最大整除子集](https://leetcode-cn.com/problems/largest-divisible-subset/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/largest-divisible-subset/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-0a3jc/) | 中等 | 🤩🤩🤩🤩 | +| [740. 删除并获得点数](https://leetcode-cn.com/problems/delete-and-earn/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/delete-and-earn/solution/gong-shui-san-xie-zhuan-huan-wei-xu-lie-6c9t0/) | 中等 | 🤩🤩🤩🤩🤩 | +| [978. 最长湍流子数组](https://leetcode-cn.com/problems/longest-turbulent-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-turbulent-subarray/solution/xiang-jie-dong-tai-gui-hua-ru-he-cai-dp-3spgj/) | 中等 | 🤩🤩🤩 | | [1035. 不相交的线](https://leetcode-cn.com/problems/uncrossed-lines/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/uncrossed-lines/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-bkaas/) | 中等 | 🤩🤩🤩🤩 | | [1143. 最长公共子序列](https://leetcode-cn.com/problems/longest-common-subsequence/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-common-subsequence/solution/gong-shui-san-xie-zui-chang-gong-gong-zi-xq0h/) | 中等 | 🤩🤩🤩🤩 | -| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩🤩🤩 | -| [978. 最长湍流子数组](https://leetcode-cn.com/problems/longest-turbulent-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-turbulent-subarray/solution/xiang-jie-dong-tai-gui-hua-ru-he-cai-dp-3spgj/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/345円277円253円346円205円242円346円214円207円351円222円210円.md" "b/Index/345円277円253円346円205円242円346円214円207円351円222円210円.md" deleted file mode 100644 index 83e455b2..00000000 --- "a/Index/345円277円253円346円205円242円346円214円207円351円222円210円.md" +++ /dev/null @@ -1,4 +0,0 @@ -| 题目 | 题解 | 难度 | 推荐指数 | -| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ---------- | -| [19. 删除链表的倒数第 N 个结点](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/solution/shua-chuan-lc-lian-biao-kuai-man-zhi-zhe-1gs1/) | 中等 | 🤩🤩🤩🤩🤩 | - diff --git "a/Index/346円225円260円345円255円246円.md" "b/Index/346円225円260円345円255円246円.md" index dbeea4bd..22f2a8fa 100644 --- "a/Index/346円225円260円345円255円246円.md" +++ "b/Index/346円225円260円345円255円246円.md" @@ -8,14 +8,17 @@ | [31. 下一个排列](https://leetcode-cn.com/problems/next-permutation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/next-permutation/solution/miao-dong-xi-lie-100-cong-xia-yi-ge-pai-gog8j/) | 中等 | 🤩🤩🤩 | | [42. 接雨水](https://leetcode-cn.com/problems/trapping-rain-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/trapping-rain-water/solution/po-su-jie-fa-on2-cha-zhao-you-hua-on-dan-iu44/) | 困难 | 🤩🤩 | | [43. 字符串相乘](https://leetcode-cn.com/problems/multiply-strings/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/multiply-strings/solution/zhi-yao-ni-hui-shou-suan-cheng-fa-zhe-ti-ainl/) | 中等 | 🤩🤩🤩🤩 | -| [1442. 形成两个异或相等数组的三元组数目](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/solution/gong-shui-san-xie-xiang-jie-shi-yong-qia-7gzm/) | 中等 | 🤩🤩🤩 | -| [1738. 找出第 K 大的异或坐标值](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/solution/gong-shui-san-xie-xiang-jie-li-yong-er-w-ai0d/) | 中等 | 🤩🤩🤩 | -| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | -| [1734. 解码异或后的排列](https://leetcode-cn.com/problems/decode-xored-permutation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-permutation/solution/gong-shui-san-xie-note-bie-pian-li-yong-zeh6o/) | 中等 | 🤩🤩🤩🤩 | -| [1486. 数组异或操作](https://leetcode-cn.com/problems/xor-operation-in-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-operation-in-an-array/solution/gong-shui-san-xie-yi-ti-shuang-jie-mo-ni-dggg/) | 简单 | 🤩🤩🤩 | -| [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-array/solution/gong-shui-san-xie-li-yong-yi-huo-xing-zh-p1bi/) | 简单 | 🤩🤩🤩 | +| [231. 2 的幂](https://leetcode-cn.com/problems/power-of-two/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/power-of-two/solution/gong-shui-san-xie-2-de-mi-by-ac_oier-qm6e/) | 简单 | 🤩🤩🤩 | +| [263. 丑数](https://leetcode-cn.com/problems/ugly-number/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number/solution/gong-shui-san-xie-jian-dan-de-fen-qing-k-dlvg/) | 简单 | 🤩🤩 | +| [342. 4的幂](https://leetcode-cn.com/problems/power-of-four/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/power-of-four/solution/gong-shui-san-xie-zhuan-hua-wei-2-de-mi-y21lq/) | 简单 | 🤩🤩🤩 | +| [477. 汉明距离总和](https://leetcode-cn.com/problems/total-hamming-distance/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/total-hamming-distance/solution/gong-shui-san-xie-ying-yong-cheng-fa-yua-g21t/) | 简单 | 🤩🤩🤩 | | [633. 平方数之和](https://leetcode-cn.com/problems/sum-of-square-numbers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-square-numbers/solution/gong-shui-san-xie-yi-ti-san-jie-mei-ju-s-7qi5/) | 简单 | 🤩🤩 | | [810. 黑板异或游戏](https://leetcode-cn.com/problems/chalkboard-xor-game/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/chalkboard-xor-game/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-ges7k/) | 困难 | 🤩🤩🤩🤩 | -| [263. 丑数](https://leetcode-cn.com/problems/ugly-number/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number/solution/gong-shui-san-xie-jian-dan-de-fen-qing-k-dlvg/) | 简单 | 🤩🤩 | | [1006. 笨阶乘](https://leetcode-cn.com/problems/clumsy-factorial/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/clumsy-factorial/solution/gong-shui-san-xie-tong-yong-biao-da-shi-nngfp/) | 中等 | 🤩🤩🤩 | +| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | +| [1442. 形成两个异或相等数组的三元组数目](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-triplets-that-can-form-two-arrays-of-equal-xor/solution/gong-shui-san-xie-xiang-jie-shi-yong-qia-7gzm/) | 中等 | 🤩🤩🤩 | +| [1486. 数组异或操作](https://leetcode-cn.com/problems/xor-operation-in-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-operation-in-an-array/solution/gong-shui-san-xie-yi-ti-shuang-jie-mo-ni-dggg/) | 简单 | 🤩🤩🤩 | +| [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-array/solution/gong-shui-san-xie-li-yong-yi-huo-xing-zh-p1bi/) | 简单 | 🤩🤩🤩 | +| [1734. 解码异或后的排列](https://leetcode-cn.com/problems/decode-xored-permutation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-permutation/solution/gong-shui-san-xie-note-bie-pian-li-yong-zeh6o/) | 中等 | 🤩🤩🤩🤩 | +| [1738. 找出第 K 大的异或坐标值](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/find-kth-largest-xor-coordinate-value/solution/gong-shui-san-xie-xiang-jie-li-yong-er-w-ai0d/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/346円240円210円.md" "b/Index/346円240円210円.md" index b1afec28..1db7a998 100644 --- "a/Index/346円240円210円.md" +++ "b/Index/346円240円210円.md" @@ -2,9 +2,9 @@ | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | | [20. 有效的括号](https://leetcode-cn.com/problems/valid-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/valid-parentheses/solution/shua-chuan-lc-zhan-ascii-chai-zhi-jie-fa-00zo/) | 简单 | 🤩🤩🤩🤩🤩 | | [32. 最长有效括号](https://leetcode-cn.com/problems/longest-valid-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-valid-parentheses/solution/shua-chuan-lc-miao-dong-xi-lie-shi-yong-95ezk/) | 困难 | 🤩🤩🤩🤩 | -| [面试题 03.01. 三合一](https://leetcode-cn.com/problems/three-in-one-lcci/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/three-in-one-lcci/solution/yi-ti-shuang-jie-er-wei-shu-zu-yi-wei-sh-lih7/) | 简单 | 🤩🤩🤩 | -| [341. 扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flatten-nested-list-iterator/solution/yi-ti-shuang-jie-dfsdui-lie-di-gui-zhan-kvwhy/) | 中等 | 🤩🤩🤩 | | [155. 最小栈](https://leetcode-cn.com/problems/min-stack/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/min-stack/solution/tu-li-zhan-shi-shuang-zhan-shi-xian-zui-fcwj5/) | 简单 | 🤩🤩🤩🤩🤩 | -| [1190. 反转每对括号间的子串](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/solution/gong-shui-san-xie-shi-yong-shuang-duan-d-r35q/) | 中等 | 🤩🤩🤩🤩🤩 | | [232. 用栈实现队列](https://leetcode-cn.com/problems/implement-queue-using-stacks/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/implement-queue-using-stacks/solution/sha-shi-jun-tan-fu-za-du-ya-wo-de-suan-f-gb6d/) | 简单 | 🤩🤩🤩🤩🤩 | +| [341. 扁平化嵌套列表迭代器](https://leetcode-cn.com/problems/flatten-nested-list-iterator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/flatten-nested-list-iterator/solution/yi-ti-shuang-jie-dfsdui-lie-di-gui-zhan-kvwhy/) | 中等 | 🤩🤩🤩 | +| [1190. 反转每对括号间的子串](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/solution/gong-shui-san-xie-shi-yong-shuang-duan-d-r35q/) | 中等 | 🤩🤩🤩🤩🤩 | +| [面试题 03.01. 三合一](https://leetcode-cn.com/problems/three-in-one-lcci/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/three-in-one-lcci/solution/yi-ti-shuang-jie-er-wei-shu-zu-yi-wei-sh-lih7/) | 简单 | 🤩🤩🤩 | diff --git "a/Index/346円240円221円347円212円266円346円225円260円347円273円204円.md" "b/Index/346円240円221円347円212円266円346円225円260円347円273円204円.md" index 164b69b9..c951ed42 100644 --- "a/Index/346円240円221円347円212円266円346円225円260円347円273円204円.md" +++ "b/Index/346円240円221円347円212円266円346円225円260円347円273円204円.md" @@ -1,6 +1,6 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | -| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩 | | [307. 区域和检索 - 数组可修改](https://leetcode-cn.com/problems/range-sum-query-mutable/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-query-mutable/solution/guan-yu-ge-lei-qu-jian-he-wen-ti-ru-he-x-41hv/) | 中等 | 🤩🤩🤩🤩🤩 | +| [354. 俄罗斯套娃信封问题](https://leetcode-cn.com/problems/russian-doll-envelopes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/russian-doll-envelopes/solution/zui-chang-shang-sheng-zi-xu-lie-bian-xin-6s8d/) | 困难 | 🤩🤩🤩 | +| [1310. 子数组异或查询](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-queries-of-a-subarray/solution/gong-shui-san-xie-yi-ti-shuang-jie-shu-z-rcgu/) | 中等 | 🤩🤩🤩🤩 | diff --git "a/Index/346円240円221円347円232円204円346円220円234円347円264円242円.md" "b/Index/346円240円221円347円232円204円346円220円234円347円264円242円.md" index a16e5cd4..353f4f63 100644 --- "a/Index/346円240円221円347円232円204円346円220円234円347円264円242円.md" +++ "b/Index/346円240円221円347円232円204円346円220円234円347円264円242円.md" @@ -1,11 +1,11 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | -| [872. 叶子相似的树](https://leetcode-cn.com/problems/leaf-similar-trees/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/leaf-similar-trees/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-udfc/) | 简单 | 🤩🤩🤩 | -| [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-of-bst/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-q2fo/) | 简单 | 🤩🤩🤩 | -| [897. 递增顺序搜索树](https://leetcode-cn.com/problems/increasing-order-search-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/increasing-order-search-tree/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-yc8l/) | 简单 | 🤩🤩🤩🤩 | -| [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/solution/gong-shui-san-xie-yi-ti-san-jie-shu-de-s-7r17/) | 简单 | 🤩🤩🤩 | | [74. 搜索二维矩阵](https://leetcode-cn.com/problems/search-a-2d-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/search-a-2d-matrix/solution/gong-shui-san-xie-yi-ti-shuang-jie-er-fe-l0pq/) | 中等 | 🤩🤩🤩🤩 | | [173. 二叉搜索树迭代器](https://leetcode-cn.com/problems/binary-search-tree-iterator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/binary-search-tree-iterator/solution/xiang-jie-ru-he-dui-die-dai-ban-de-zhong-4rxj/) | 中等 | 🤩🤩🤩🤩 | | [331. 验证二叉树的前序序列化](https://leetcode-cn.com/problems/verify-preorder-serialization-of-a-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/verify-preorder-serialization-of-a-binary-tree/solution/xiang-xin-ke-xue-xi-lie-xiang-jie-zhi-gu-e3y9/) | 中等 | 🤩🤩🤩 | +| [783. 二叉搜索树节点最小距离](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-distance-between-bst-nodes/solution/gong-shui-san-xie-yi-ti-san-jie-shu-de-s-7r17/) | 简单 | 🤩🤩🤩 | +| [872. 叶子相似的树](https://leetcode-cn.com/problems/leaf-similar-trees/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/leaf-similar-trees/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-udfc/) | 简单 | 🤩🤩🤩 | +| [897. 递增顺序搜索树](https://leetcode-cn.com/problems/increasing-order-search-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/increasing-order-search-tree/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-yc8l/) | 简单 | 🤩🤩🤩🤩 | +| [938. 二叉搜索树的范围和](https://leetcode-cn.com/problems/range-sum-of-bst/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/range-sum-of-bst/solution/gong-shui-san-xie-yi-ti-shuang-jie-di-gu-q2fo/) | 简单 | 🤩🤩🤩 | +| [993. 二叉树的堂兄弟节点](https://leetcode-cn.com/problems/cousins-in-binary-tree/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/cousins-in-binary-tree/solution/gong-shui-san-xie-shu-de-sou-suo-dfs-bfs-b200/) | 简单 | 🤩🤩 | diff --git "a/Index/346円250円241円346円213円237円.md" "b/Index/346円250円241円346円213円237円.md" index 49815c51..2774b7ba 100644 --- "a/Index/346円250円241円346円213円237円.md" +++ "b/Index/346円250円241円346円213円237円.md" @@ -12,17 +12,17 @@ | [31. 下一个排列](https://leetcode-cn.com/problems/next-permutation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/next-permutation/solution/miao-dong-xi-lie-100-cong-xia-yi-ge-pai-gog8j/) | 中等 | 🤩🤩🤩 | | [38. 外观数列](https://leetcode-cn.com/problems/count-and-say/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/count-and-say/solution/shua-chuan-lc-100-mo-ni-ti-shi-yong-shao-w8jl/) | 简单 | 🤩🤩 | | [43. 字符串相乘](https://leetcode-cn.com/problems/multiply-strings/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/multiply-strings/solution/zhi-yao-ni-hui-shou-suan-cheng-fa-zhe-ti-ainl/) | 中等 | 🤩🤩🤩🤩 | -| [1748. 唯一元素的和](https://leetcode-cn.com/problems/sum-of-unique-elements/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-unique-elements/solution/mo-ni-ti-po-su-jie-fa-by-ac_oier-ff69/) | 简单 | 🤩🤩 | -| [1486. 数组异或操作](https://leetcode-cn.com/problems/xor-operation-in-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-operation-in-an-array/solution/gong-shui-san-xie-yi-ti-shuang-jie-mo-ni-dggg/) | 简单 | 🤩🤩🤩 | -| [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-array/solution/gong-shui-san-xie-li-yong-yi-huo-xing-zh-p1bi/) | 简单 | 🤩🤩🤩 | -| [263. 丑数](https://leetcode-cn.com/problems/ugly-number/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number/solution/gong-shui-san-xie-jian-dan-de-fen-qing-k-dlvg/) | 简单 | 🤩🤩 | -| [190. 颠倒二进制位](https://leetcode-cn.com/problems/reverse-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-bits/solution/yi-ti-san-jie-dui-cheng-wei-zhu-wei-fen-ub1hi/) | 简单 | 🤩🤩🤩 | -| [73. 矩阵置零](https://leetcode-cn.com/problems/set-matrix-zeroes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/set-matrix-zeroes/solution/xiang-jie-fen-san-bu-de-o1-kong-jian-jie-dbxd/) | 中等 | 🤩🤩🤩🤩 | | [59. 螺旋矩阵 II](https://leetcode-cn.com/problems/spiral-matrix-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/spiral-matrix-ii/solution/yi-ti-shuang-jie-xiang-jie-xing-zhuang-j-24x8/) | 中等 | 🤩🤩🤩🤩 | -| [1047. 删除字符串中的所有相邻重复项](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/solution/cong-30-dao-100wu-chong-shi-xian-jie-jue-vkah/) | 简单 | 🤩🤩🤩🤩 | -| [896. 单调数列](https://leetcode-cn.com/problems/monotonic-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/monotonic-array/solution/wei-shi-yao-yi-ci-bian-li-yao-bi-liang-c-uglp/) | 简单 | 🤩🤩🤩🤩 | -| [867. 转置矩阵](https://leetcode-cn.com/problems/transpose-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/transpose-matrix/solution/yi-you-wei-jin-huo-xu-ni-neng-kan-kan-zh-m53m/) | 简单 | 🤩🤩🤩🤩 | -| [766. 托普利茨矩阵](https://leetcode-cn.com/problems/toeplitz-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/toeplitz-matrix/solution/cong-ci-pan-du-qu-cheng-ben-fen-xi-liang-f20w/) | 简单 | 🤩🤩🤩 | -| [1763. 最长的美好子字符串](https://leetcode-cn.com/problems/longest-nice-substring/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-nice-substring/solution/cong-shu-ju-fan-wei-xuan-ze-he-gua-suan-n3y2a/) | 简单 | 🤩🤩🤩 | +| [73. 矩阵置零](https://leetcode-cn.com/problems/set-matrix-zeroes/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/set-matrix-zeroes/solution/xiang-jie-fen-san-bu-de-o1-kong-jian-jie-dbxd/) | 中等 | 🤩🤩🤩🤩 | +| [190. 颠倒二进制位](https://leetcode-cn.com/problems/reverse-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-bits/solution/yi-ti-san-jie-dui-cheng-wei-zhu-wei-fen-ub1hi/) | 简单 | 🤩🤩🤩 | +| [263. 丑数](https://leetcode-cn.com/problems/ugly-number/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/ugly-number/solution/gong-shui-san-xie-jian-dan-de-fen-qing-k-dlvg/) | 简单 | 🤩🤩 | | [566. 重塑矩阵](https://leetcode-cn.com/problems/reshape-the-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reshape-the-matrix/solution/jian-dan-ti-zhong-quan-chu-ji-ke-yi-kan-79gv5/) | 简单 | 🤩🤩🤩 | +| [766. 托普利茨矩阵](https://leetcode-cn.com/problems/toeplitz-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/toeplitz-matrix/solution/cong-ci-pan-du-qu-cheng-ben-fen-xi-liang-f20w/) | 简单 | 🤩🤩🤩 | +| [867. 转置矩阵](https://leetcode-cn.com/problems/transpose-matrix/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/transpose-matrix/solution/yi-you-wei-jin-huo-xu-ni-neng-kan-kan-zh-m53m/) | 简单 | 🤩🤩🤩🤩 | +| [896. 单调数列](https://leetcode-cn.com/problems/monotonic-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/monotonic-array/solution/wei-shi-yao-yi-ci-bian-li-yao-bi-liang-c-uglp/) | 简单 | 🤩🤩🤩🤩 | +| [1047. 删除字符串中的所有相邻重复项](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/solution/cong-30-dao-100wu-chong-shi-xian-jie-jue-vkah/) | 简单 | 🤩🤩🤩🤩 | +| [1486. 数组异或操作](https://leetcode-cn.com/problems/xor-operation-in-an-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/xor-operation-in-an-array/solution/gong-shui-san-xie-yi-ti-shuang-jie-mo-ni-dggg/) | 简单 | 🤩🤩🤩 | +| [1720. 解码异或后的数组](https://leetcode-cn.com/problems/decode-xored-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-xored-array/solution/gong-shui-san-xie-li-yong-yi-huo-xing-zh-p1bi/) | 简单 | 🤩🤩🤩 | +| [1748. 唯一元素的和](https://leetcode-cn.com/problems/sum-of-unique-elements/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sum-of-unique-elements/solution/mo-ni-ti-po-su-jie-fa-by-ac_oier-ff69/) | 简单 | 🤩🤩 | +| [1763. 最长的美好子字符串](https://leetcode-cn.com/problems/longest-nice-substring/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-nice-substring/solution/cong-shu-ju-fan-wei-xuan-ze-he-gua-suan-n3y2a/) | 简单 | 🤩🤩🤩 | diff --git "a/Index/346円273円221円345円212円250円347円252円227円345円217円243円.md" "b/Index/346円273円221円345円212円250円347円252円227円345円217円243円.md" index 5b1de882..7c5c52f0 100644 --- "a/Index/346円273円221円345円212円250円347円252円227円345円217円243円.md" +++ "b/Index/346円273円221円345円212円250円347円252円227円345円217円243円.md" @@ -2,15 +2,15 @@ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---- | ---------- | | [3. 无重复字符的最长子串 ](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/solution/shua-chuan-lc-shuang-zhi-zhen-ha-xi-biao-q08m/) | 中等 | 🤩🤩🤩🤩🤩 | | [30. 串联所有单词的子串](https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/substring-with-concatenation-of-all-words/solution/shua-chuan-lc-po-su-ha-xi-biao-jie-fa-hu-ml3x/) | 困难 | 🤩🤩 | +| [220. 存在重复元素 III](https://leetcode-cn.com/problems/contains-duplicate-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/contains-duplicate-iii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hua-d-dlnv/) | 中等 | 🤩🤩🤩 | | [424. 替换后的最长重复字符](https://leetcode-cn.com/problems/longest-repeating-character-replacement/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-repeating-character-replacement/solution/ping-ping-wu-qi-shuang-zhi-zhen-da-bai-h-fgif/) | 中等 | 🤩🤩🤩🤩 | | [480. 滑动窗口中位数](https://leetcode-cn.com/problems/sliding-window-median/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/sliding-window-median/solution/xiang-jie-po-su-jie-fa-you-xian-dui-lie-mo397/) | 困难 | 🤩🤩🤩🤩 | +| [567. 字符串的排列](https://leetcode-cn.com/problems/permutation-in-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/permutation-in-string/solution/an-zi-fu-hua-dong-ruo-bao-liao-lai-shi-s-h2xq/) | 中等 | 🤩🤩🤩 | | [643. 子数组最大平均数 I](https://leetcode-cn.com/problems/maximum-average-subarray-i/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-average-subarray-i/solution/hua-dong-chuang-kou-luo-ti-han-mo-ban-by-buo3/) | 简单 | 🤩🤩🤩🤩🤩 | -| [1208. 尽可能使字符串相等](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/solution/ni-bu-ke-neng-kan-bu-dong-de-qian-zhui-h-u4l1/) | 中等 | 🤩🤩🤩 | +| [992. K 个不同整数的子数组](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/solution/miao-dong-xi-lie-xiang-jie-shuang-zhi-zh-9k8w/) | 困难 | 🤩🤩🤩🤩 | +| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | +| [1052. 爱生气的书店老板](https://leetcode-cn.com/problems/grumpy-bookstore-owner/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/grumpy-bookstore-owner/solution/hua-dong-chuang-kou-luo-ti-by-ac_oier-nunu/) | 中等 | 🤩🤩🤩 | +| [1208. 尽可能使字符串相等](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/get-equal-substrings-within-budget/solution/ni-bu-ke-neng-kan-bu-dong-de-qian-zhui-h-u4l1/) | 中等 | 🤩🤩🤩 | | [1423. 可获得的最大点数](https://leetcode-cn.com/problems/maximum-points-you-can-obtain-from-cards/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-points-you-can-obtain-from-cards/solution/jian-dan-de-hua-dong-chuang-kou-he-kuai-1go5h/) | 中等 | 🤩🤩🤩🤩 | -| [220. 存在重复元素 III](https://leetcode-cn.com/problems/contains-duplicate-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/contains-duplicate-iii/solution/gong-shui-san-xie-yi-ti-shuang-jie-hua-d-dlnv/) | 中等 | 🤩🤩🤩 | -| [1052. 爱生气的书店老板](https://leetcode-cn.com/problems/grumpy-bookstore-owner/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/grumpy-bookstore-owner/solution/hua-dong-chuang-kou-luo-ti-by-ac_oier-nunu/) | 中等 | 🤩🤩🤩 | | [1438. 绝对差不超过限制的最长连续子数组](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit/solution/xiang-jie-er-fen-hua-dong-chuang-kou-dan-41g1/) | 中等 | 🤩🤩🤩 | -| [1004. 最大连续1的个数 III](https://leetcode-cn.com/problems/max-consecutive-ones-iii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/max-consecutive-ones-iii/solution/san-chong-jie-fa-cong-dong-tai-gui-hua-d-gxks/) | 中等 | 🤩🤩🤩 | -| [567. 字符串的排列](https://leetcode-cn.com/problems/permutation-in-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/permutation-in-string/solution/an-zi-fu-hua-dong-ruo-bao-liao-lai-shi-s-h2xq/) | 中等 | 🤩🤩🤩 | -| [992. K 个不同整数的子数组](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/subarrays-with-k-different-integers/solution/miao-dong-xi-lie-xiang-jie-shuang-zhi-zh-9k8w/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/346円225円260円347円273円204円347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" "b/Index/347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" similarity index 100% rename from "Index/346円225円260円347円273円204円347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" rename to "Index/347円247円273円351円231円244円345円205円203円347円264円240円351円227円256円351円242円230円.md" diff --git "a/Index/347円272円277円346円200円247円 DP.md" "b/Index/347円272円277円346円200円247円 DP.md" index 16cac321..3032c2a4 100644 --- "a/Index/347円272円277円346円200円247円 DP.md" +++ "b/Index/347円272円277円346円200円247円 DP.md" @@ -1,14 +1,14 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- | -------- | | [10. 正则表达式匹配 ](https://leetcode-cn.com/problems/regular-expression-matching) | [LeetCode 题解链接](https://leetcode-cn.com/problems/regular-expression-matching/solution/shua-chuan-lc-dong-tai-gui-hua-jie-fa-by-zn9w/) | 困难 | 🤩🤩🤩🤩 | -| [45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/jump-game-ii/solution/xiang-jie-dp-tan-xin-shuang-zhi-zhen-jie-roh4/) | 中等 | 🤩🤩🤩🤩 | | [44. 通配符匹配](https://leetcode-cn.com/problems/wildcard-matching/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/wildcard-matching/solution/gong-shui-san-xie-xiang-jie-dong-tai-gui-ifyx/) | 困难 | 🤩🤩🤩🤩 | -| [1751. 最多可以参加的会议数目 II](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/solution/po-su-dp-er-fen-dp-jie-fa-by-ac_oier-88du/) | 困难 | 🤩🤩🤩 | -| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩 | +| [45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/jump-game-ii/solution/xiang-jie-dp-tan-xin-shuang-zhi-zhen-jie-roh4/) | 中等 | 🤩🤩🤩🤩 | | [91. 解码方法](https://leetcode-cn.com/problems/decode-ways/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/decode-ways/solution/gong-shui-san-xie-gen-ju-shu-ju-fan-wei-ug3dd/) | 中等 | 🤩🤩🤩 | -| [213. 打家劫舍 II](https://leetcode-cn.com/problems/house-robber-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/house-robber-ii/solution/gong-shui-san-xie-ru-he-jiang-xin-xian-z-zf0w/) | 中等 | 🤩🤩🤩 | -| [1787. 使所有区间的异或结果为零](https://leetcode-cn.com/problems/make-the-xor-of-all-segments-equal-to-zero/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/make-the-xor-of-all-segments-equal-to-zero/solution/gong-shui-san-xie-chou-xiang-cheng-er-we-ww79/) | 困难 | 🤩🤩🤩🤩 | | [115. 不同的子序列](https://leetcode-cn.com/problems/distinct-subsequences/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/distinct-subsequences/solution/xiang-jie-zi-fu-chuan-pi-pei-wen-ti-de-t-wdtk/) | 困难 | 🤩🤩🤩🤩 | -| [338. 比特位计数](https://leetcode-cn.com/problems/counting-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/counting-bits/solution/po-su-jie-fa-dong-tai-gui-hua-jie-fa-by-vvail/) | 简单 | 🤩🤩🤩 | | [119. 杨辉三角 II](https://leetcode-cn.com/problems/pascals-triangle-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/pascals-triangle-ii/solution/dong-tai-gui-hua-luo-ti-chang-jian-de-ko-n2xj/) | 简单 | 🤩🤩🤩 | +| [213. 打家劫舍 II](https://leetcode-cn.com/problems/house-robber-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/house-robber-ii/solution/gong-shui-san-xie-ru-he-jiang-xin-xian-z-zf0w/) | 中等 | 🤩🤩🤩 | +| [338. 比特位计数](https://leetcode-cn.com/problems/counting-bits/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/counting-bits/solution/po-su-jie-fa-dong-tai-gui-hua-jie-fa-by-vvail/) | 简单 | 🤩🤩🤩 | +| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩 | +| [1751. 最多可以参加的会议数目 II](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-number-of-events-that-can-be-attended-ii/solution/po-su-dp-er-fen-dp-jie-fa-by-ac_oier-88du/) | 困难 | 🤩🤩🤩 | +| [1787. 使所有区间的异或结果为零](https://leetcode-cn.com/problems/make-the-xor-of-all-segments-equal-to-zero/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/make-the-xor-of-all-segments-equal-to-zero/solution/gong-shui-san-xie-chou-xiang-cheng-er-we-ww79/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/350円203円214円345円214円205円 DP.md" "b/Index/350円203円214円345円214円205円 DP.md" index f05f760c..6419143a 100644 --- "a/Index/350円203円214円345円214円205円 DP.md" +++ "b/Index/350円203円214円345円214円205円 DP.md" @@ -1,5 +1,4 @@ | 题目 | 题解 | 难度 | | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | ----- | | [416. 分割等和子集](https://leetcode-cn.com/problems/partition-equal-subset-sum/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/partition-equal-subset-sum/solution/gong-shui-san-xie-bei-bao-wen-ti-xia-con-mr8a/) | 中等 | 🤩🤩🤩🤩🤩 | -| [416. 分割等和子集](https://leetcode-cn.com/problems/partition-equal-subset-sum/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/partition-equal-subset-sum/solution/gong-shui-san-xie-bei-bao-wen-ti-shang-r-ln14/) | 中等 | 🤩🤩🤩🤩🤩 | diff --git "a/Index/350円241円250円350円276円276円345円274円217円350円256円241円347円256円227円351円227円256円351円242円230円.md" "b/Index/350円241円250円350円276円276円345円274円217円350円256円241円347円256円227円351円227円256円351円242円230円.md" index cd7cb9f1..fbb18dc6 100644 --- "a/Index/350円241円250円350円276円276円345円274円217円350円256円241円347円256円227円351円227円256円351円242円230円.md" +++ "b/Index/350円241円250円350円276円276円345円274円217円350円256円241円347円256円227円351円227円256円351円242円230円.md" @@ -1,7 +1,7 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [1006. 笨阶乘](https://leetcode-cn.com/problems/clumsy-factorial/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/clumsy-factorial/solution/gong-shui-san-xie-tong-yong-biao-da-shi-nngfp/) | 中等 | 🤩🤩🤩 | | [150. 逆波兰表达式求值](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/solution/yi-ti-shuang-jie-xi-tong-zhan-shu-zu-mo-i1eq3/) | 中等 | 🤩🤩🤩🤩 | -| [227. 基本计算器 II](https://leetcode-cn.com/problems/basic-calculator-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/basic-calculator-ii/solution/shi-yong-shuang-zhan-jie-jue-jiu-ji-biao-c65k/) | 中等 | 🤩🤩🤩🤩 | | [224. 基本计算器](https://leetcode-cn.com/problems/basic-calculator/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/basic-calculator/solution/shuang-zhan-jie-jue-tong-yong-biao-da-sh-olym/) | 困难 | 🤩🤩🤩🤩 | +| [227. 基本计算器 II](https://leetcode-cn.com/problems/basic-calculator-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/basic-calculator-ii/solution/shi-yong-shuang-zhan-jie-jue-jiu-ji-biao-c65k/) | 中等 | 🤩🤩🤩🤩 | +| [1006. 笨阶乘](https://leetcode-cn.com/problems/clumsy-factorial/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/clumsy-factorial/solution/gong-shui-san-xie-tong-yong-biao-da-shi-nngfp/) | 中等 | 🤩🤩🤩 | diff --git "a/Index/350円256円260円345円277円206円345円214円226円346円220円234円347円264円242円.md" "b/Index/350円256円260円345円277円206円345円214円226円346円220円234円347円264円242円.md" index 51b5e200..2536734a 100644 --- "a/Index/350円256円260円345円277円206円345円214円226円346円220円234円347円264円242円.md" +++ "b/Index/350円256円260円345円277円206円345円214円226円346円220円234円347円264円242円.md" @@ -1,5 +1,5 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩🤩 | | [87. 扰乱字符串](https://leetcode-cn.com/problems/scramble-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/scramble-string/solution/gong-shui-san-xie-yi-ti-san-jie-di-gui-j-hybk/) | 困难 | 🤩🤩🤩 | +| [403. 青蛙过河](https://leetcode-cn.com/problems/frog-jump/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/frog-jump/solution/gong-shui-san-xie-yi-ti-duo-jie-jiang-di-74fw/) | 困难 | 🤩🤩🤩🤩 | diff --git "a/Index/350円264円252円345円277円203円347円256円227円346円263円225円.md" "b/Index/350円264円252円345円277円203円347円256円227円346円263円225円.md" index 67e33e97..bcd6d54c 100644 --- "a/Index/350円264円252円345円277円203円347円256円227円346円263円225円.md" +++ "b/Index/350円264円252円345円277円203円347円256円227円346円263円225円.md" @@ -3,9 +3,9 @@ | [11. 盛最多水的容器 ](https://leetcode-cn.com/problems/container-with-most-water/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/) | 中等 | 🤩🤩🤩🤩🤩 | | [45. 跳跃游戏 II](https://leetcode-cn.com/problems/jump-game-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/jump-game-ii/solution/xiang-jie-dp-tan-xin-shuang-zhi-zhen-jie-roh4/) | 中等 | 🤩🤩🤩🤩 | | [179. 最大数](https://leetcode-cn.com/problems/largest-number/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/largest-number/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-vn86e/) | 中等 | 🤩🤩🤩🤩 | -| [1707. 与数组中元素的最大异或值](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/solution/gong-shui-san-xie-jie-zhe-ge-wen-ti-lai-lypqr/) | 困难 | 🤩🤩🤩 | -| [781. 森林中的兔子](https://leetcode-cn.com/problems/rabbits-in-forest/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/rabbits-in-forest/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-v17p5/) | 中等 | 🤩🤩🤩🤩 | -| [995. K 连续位的最小翻转次数](https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips/solution/po-su-tan-xin-jie-fa-yu-tan-xin-chai-fen-4lyy/) | 困难 | 🤩🤩🤩 | | [561. 数组拆分 I](https://leetcode-cn.com/problems/array-partition-i/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/array-partition-i/solution/jue-dui-neng-kan-dong-de-zheng-ming-fan-f7trz/) | 简单 | 🤩🤩🤩🤩 | | [765. 情侣牵手](https://leetcode-cn.com/problems/couples-holding-hands/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/couples-holding-hands/solution/liang-chong-100-de-jie-fa-bing-cha-ji-ta-26a6/) | 困难 | 🤩🤩🤩 | +| [781. 森林中的兔子](https://leetcode-cn.com/problems/rabbits-in-forest/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/rabbits-in-forest/solution/gong-shui-san-xie-noxiang-xin-ke-xue-xi-v17p5/) | 中等 | 🤩🤩🤩🤩 | +| [995. K 连续位的最小翻转次数](https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/minimum-number-of-k-consecutive-bit-flips/solution/po-su-tan-xin-jie-fa-yu-tan-xin-chai-fen-4lyy/) | 困难 | 🤩🤩🤩 | +| [1707. 与数组中元素的最大异或值](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/maximum-xor-with-an-element-from-array/solution/gong-shui-san-xie-jie-zhe-ge-wen-ti-lai-lypqr/) | 困难 | 🤩🤩🤩 | diff --git "a/Index/351円223円276円350円241円250円.md" "b/Index/351円223円276円350円241円250円.md" index 1b1493cd..e4f6dcb9 100644 --- "a/Index/351円223円276円350円241円250円.md" +++ "b/Index/351円223円276円350円241円250円.md" @@ -10,4 +10,5 @@ | [83. 删除排序链表中的重复元素](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list/solution/tong-yong-shan-chu-zhong-fu-jie-dian-lia-101c/) | 简单 | 🤩🤩🤩🤩🤩 | | [82. 删除排序链表中的重复元素 II](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-duplicates-from-sorted-list-ii/solution/tong-yong-shan-chu-zhong-fu-jie-dian-lia-od9g/) | 简单 | 🤩🤩🤩🤩🤩 | | [92. 反转链表 II](https://leetcode-cn.com/problems/reverse-linked-list-ii/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-linked-list-ii/solution/yi-ge-neng-ying-yong-suo-you-lian-biao-t-vjx6/) | 中等 | 🤩🤩🤩 | +| [146. LRU 缓存机制](https://leetcode-cn.com/problems/lru-cache/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/lru-cache/solution/gong-shui-san-xie-she-ji-shu-ju-jie-gou-68hv2/) | 中等 | 🤩🤩🤩🤩🤩 | diff --git "a/Index/351円230円237円345円210円227円.md" "b/Index/351円230円237円345円210円227円.md" index 2b1dcfca..fc1688e2 100644 --- "a/Index/351円230円237円345円210円227円.md" +++ "b/Index/351円230円237円345円210円227円.md" @@ -1,5 +1,5 @@ | 题目 | 题解 | 难度 | 推荐指数 | | ------------------------------------------------------------ | ------------------------------------------------------------ | ---- | -------- | -| [1190. 反转每对括号间的子串](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/solution/gong-shui-san-xie-shi-yong-shuang-duan-d-r35q/) | 中等 | 🤩🤩🤩🤩🤩 | | [1047. 删除字符串中的所有相邻重复项](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/remove-all-adjacent-duplicates-in-string/solution/cong-30-dao-100wu-chong-shi-xian-jie-jue-vkah/) | 简单 | 🤩🤩🤩🤩 | +| [1190. 反转每对括号间的子串](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/) | [LeetCode 题解链接](https://leetcode-cn.com/problems/reverse-substrings-between-each-pair-of-parentheses/solution/gong-shui-san-xie-shi-yong-shuang-duan-d-r35q/) | 中等 | 🤩🤩🤩🤩🤩 | diff --git "a/LeetCode/11-20/18. 345円233円233円346円225円260円344円271円213円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/11-20/18. 345円233円233円346円225円260円344円271円213円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" index 49059e6c..be8c65c6 100644 --- "a/LeetCode/11-20/18. 345円233円233円346円225円260円344円271円213円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" +++ "b/LeetCode/11-20/18. 345円233円233円346円225円260円344円271円213円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -86,7 +86,7 @@ class Solution { } ``` * 时间复杂度:`i` 和 `j` 是直接枚举确定,复杂度为 $O(n^2),ドル当确定下来 `i` 和 `j` 之后,通过双指针确定 `k` 和 `p` ,也就是对于每一组 `i` 和 `j` 而言复杂度为 $O(n)$。总的复杂度为 $O(n^3)$ -* 空间复杂度:$O(n ^ 2)$ +* 空间复杂度:$O(n)$ --- ### 最后 diff --git "a/LeetCode/1171-1180/1074. 345円205円203円347円264円240円345円222円214円344円270円272円347円233円256円346円240円207円345円200円274円347円232円204円345円255円220円347円237円251円351円230円265円346円225円260円351円207円217円357円274円210円345円233円260円351円232円276円357円274円211円.md" "b/LeetCode/1171-1180/1074. 345円205円203円347円264円240円345円222円214円344円270円272円347円233円256円346円240円207円345円200円274円347円232円204円345円255円220円347円237円251円351円230円265円346円225円260円351円207円217円357円274円210円345円233円260円351円232円276円357円274円211円.md" new file mode 100644 index 00000000..3bfd2052 --- /dev/null +++ "b/LeetCode/1171-1180/1074. 345円205円203円347円264円240円345円222円214円344円270円272円347円233円256円346円240円207円345円200円274円347円232円204円345円255円220円347円237円251円351円230円265円346円225円260円351円207円217円357円274円210円345円233円260円351円232円276円357円274円211円.md" @@ -0,0 +1,152 @@ +### 题目描述 + +这是 LeetCode 上的 **[1074. 元素和为目标值的子矩阵数量](https://leetcode-cn.com/problems/number-of-submatrices-that-sum-to-target/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-uttw/)** ,难度为 **困难**。 + +Tag : 「前缀和」、「哈希表」 + + + +给出矩阵 matrix 和目标值 target,返回元素总和等于目标值的非空子矩阵的数量。 + +子矩阵 x1, y1, x2, y2 是满足 x1 <= x <= x2 且 y1 <= y <= y2 的所有单元 matrix[x][y] 的集合。 + +如果 (x1, y1, x2, y2) 和 (x1', y1', x2', y2') 两个子矩阵中部分坐标不同(如:x1 != x1'),那么这两个子矩阵也不同。 + + + +示例 1: + +![](https://assets.leetcode.com/uploads/2020/09/02/mate1.jpg) + +``` +输入:matrix = [[0,1,0],[1,1,1],[0,1,0]], target = 0 +输出:4 +解释:四个只含 0 的 1x1 子矩阵。 +``` +示例 2: +``` +输入:matrix = [[1,-1],[-1,1]], target = 0 +输出:5 +解释:两个 1x2 子矩阵,加上两个 2x1 子矩阵,再加上一个 2x2 子矩阵。 +``` +示例 3: +``` +输入:matrix = [[904]], target = 0 +输出:0 +``` + +提示: +* 1 <= matrix.length <= 100 +* 1 <= matrix[0].length <= 100 +* -1000 <= matrix[i] <= 1000 +* -10ドル^8$ <= target <= 10ドル^8$ + +--- + +### 朴素二维前缀和 + +从题面来看显然是一道「二维前缀和」的题目,如果你还不了解「二维前缀和」,可以看看 [(题解)304. 二维区域和检索 - 矩阵不可变](https://leetcode-cn.com/problems/range-sum-query-2d-immutable/solution/xia-ci-ru-he-zai-30-miao-nei-zuo-chu-lai-ptlo/)。本题预处理前缀和的复杂度为 $O(m * n)$。 + +搜索所有子矩阵需要枚举「矩形左上角」和「矩形右下角」,复杂度是 $O(m^2 * n^2)$。 + +因此,如果把本题当做二维前缀和模板题来做的话,整体复杂度是 $O(m^2 * n^2)$。 + +数据范围是 10ドル^2,ドル对应的计算量是 10ドル^8,ドル处于超时边缘,但当我们枚举「矩阵右下角」$(i,j)$ 的时候,我们只需要搜索位于 $(i,j)$ 的左上方的点 $(p,q)$ 作为「矩阵左上角」,所以其实我们是取不满 $m^2 * n^2$ 的,但仍然具有超时风险(2021/05/29 Java 测试可通过)。 + +代码: +```Java [] +class Solution { + public int numSubmatrixSumTarget(int[][] mat, int t) { + int n = mat.length, m = mat[0].length; + int[][] sum = new int[n + 1][m + 1]; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= m; j++) { + sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + mat[i - 1][j - 1]; + } + } + int ans = 0; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= m; j++) { + for (int p = 1; p <= i; p++) { + for (int q = 1; q <= j; q++) { + if (sum[i][j] - sum[p - 1][j] - sum[i][q - 1] + sum[p - 1][q - 1] == t) ans++; + } + } + } + } + return ans; + } +} +``` +* 时间复杂度:$O(m^2 * n^2)$ +* 空间复杂度:$O(m * n)$ + +--- + +### 优化枚举 + 哈希表 + +上述分析是从「点」上来确定一个子矩阵,在 $n$ 和 $m$ 同阶的情况下,复杂度是 $O(n^4)$ 的。 + +事实上,我们能从「边」的角度来确定一个子矩阵,通过枚举三条边,然后加速找第四条边的过程,这样可以将复杂度降到 $O(n^3)$。 + +**这个分析思路在 [(题解)363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) 详细讲过,没有印象的同学可以翻翻。这道题一定程度上是那道题的简化版,在本题我们只需要找到矩阵和为 $target$ 的值,因此只需要使用「哈希表」来记录出现过的值即可,而在 [(原题)363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/) 中,我们需要找到和不超过 $k$ 的最大子矩阵,因此还涉及「有序集合 + 二分」。** + +具体的,我们仍然需要先预处理出一个二维前缀和。**然后通过枚举确定「子矩阵的上下边界」,在将「子矩阵右边界」不断右移的过程中,把「子矩阵右边界」到「原矩阵左边界」行程的矩阵和存入哈希表(因为要统计数量,存储格式为 {"面积":"出现次数"} ),然后通过容斥原理来找到目标的「子矩阵左边界」。** + +假设当前我们「子矩阵的上下边界」已经固定,当枚举到某个「子矩阵右边界」时,我们先通过二维前缀和计算出「子矩阵右边界」和「原矩阵左边界」形成的矩阵和 $cur,ドル由于我们希望找到矩阵和为 $target$ 的子矩阵,即希望找到一个「子矩阵左边界」使得矩阵和满足要求,这等价于从「哈希表」中找到一个 $x,ドル使得 $cur - x = target,ドル这是一个 $O(1)$ 操作。 + +![image.png](https://pic.leetcode-cn.com/1622250565-sdYzhq-image.png) + +代码: +```Java [] +class Solution { + public int numSubmatrixSumTarget(int[][] mat, int t) { + int n = mat.length, m = mat[0].length; + int[][] sum = new int[n + 1][m + 1]; + for (int i = 1; i <= n; i++) { + for (int j = 1; j <= m; j++) { + sum[i][j] = sum[i - 1][j] + sum[i][j - 1] - sum[i - 1][j - 1] + mat[i - 1][j - 1]; + } + } + int ans = 0; + for (int top = 1; top <= n; top++) { + for (int bot = top; bot <= n; bot++) { + int cur = 0; + Map map = new HashMap(); + for (int r = 1; r <= m; r++) { + cur = sum[bot][r] - sum[top - 1][r]; + if (cur == t) ans++; + if (map.containsKey(cur - t)) ans += map.get(cur - t); + map.put(cur, map.getOrDefault(cur, 0) + 1); + } + } + } + return ans; + } +} +``` +* 时间复杂度:$O(m * n^2)$ +* 空间复杂度:$O(m * n)$ + +--- + +### 进阶 + +1. 【时间复杂度】在上述解法中,我们采用的是**固定上下边界,移动右边界,通过哈希表找左边界**的做法,复杂度为 $O(m * n^2)$;自然也能改为**固定左右边界,移动下边界,通过哈希表找上边界**做法,复杂度为 $O(m^2 * n)$。那么我们要如何调整代码,才能最大化「哈希表」带来的优化效果呢?此时的复杂度又是多少? + +2. 【空间复杂度】我们空间复杂度的瓶颈在「二维前缀和」上,但注意到无论我们采取「固定上下边界」还是「固定左右边界」的做法,扫描原矩阵的方向都是固定的,那么是否可以不预处理「二维前缀和」呢?从而将空间复杂度降低到 $O(\max(n, m))$ 呢? + +上述两问,你都可以在 [(题解)363. 矩形区域不超过 K 的最大数值和](https://leetcode-cn.com/problems/max-sum-of-rectangle-no-larger-than-k/solution/gong-shui-san-xie-you-hua-mei-ju-de-ji-b-dh8s/) 中找到答案。 + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.1074` 篇,系列开始于 2021/01/01,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 + diff --git "a/LeetCode/141-150/146. LRU 347円274円223円345円255円230円346円234円272円345円210円266円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/141-150/146. LRU 347円274円223円345円255円230円346円234円272円345円210円266円357円274円210円344円270円255円347円255円211円357円274円211円.md" new file mode 100644 index 00000000..10ae9015 --- /dev/null +++ "b/LeetCode/141-150/146. LRU 347円274円223円345円255円230円346円234円272円345円210円266円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -0,0 +1,171 @@ +### 题目描述 + +这是 LeetCode 上的 **[146. LRU 缓存机制](https://leetcode-cn.com/problems/lru-cache/solution/gong-shui-san-xie-she-ji-shu-ju-jie-gou-68hv2/)** ,难度为 **中等**。 + +Tag : 「设计」、「链表」、「哈希表」 + + + + +运用你所掌握的数据结构,设计和实现一个 LRU (最近最少使用) 缓存机制 。 +实现 LRUCache 类: + +* LRUCache(int capacity) 以正整数作为容量 capacity 初始化 LRU 缓存 +* int get(int key) 如果关键字 key 存在于缓存中,则返回关键字的值,否则返回 -1 。 +* void put(int key, int value) 如果关键字已经存在,则变更其数据值;如果关键字不存在,则插入该组「关键字-值」。当缓存容量达到上限时,它应该在写入新数据之前删除最久未使用的数据值,从而为新的数据值留出空间。 + +进阶:你是否可以在 $O(1)$ 时间复杂度内完成这两种操作? + +示例: +``` +输入 +["LRUCache", "put", "put", "get", "put", "get", "put", "get", "get", "get"] +[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]] +输出 +[null, null, null, 1, null, -1, null, -1, 3, 4] + +解释 +LRUCache lRUCache = new LRUCache(2); +lRUCache.put(1, 1); // 缓存是 {1=1} +lRUCache.put(2, 2); // 缓存是 {1=1, 2=2} +lRUCache.get(1); // 返回 1 +lRUCache.put(3, 3); // 该操作会使得关键字 2 作废,缓存是 {1=1, 3=3} +lRUCache.get(2); // 返回 -1 (未找到) +lRUCache.put(4, 4); // 该操作会使得关键字 1 作废,缓存是 {4=4, 3=3} +lRUCache.get(1); // 返回 -1 (未找到) +lRUCache.get(3); // 返回 3 +lRUCache.get(4); // 返回 4 +``` + +提示: +* 1 <= capacity <= 3000 +* 0 <= key <= 3000 +* 0 <= value <= 10ドル^4$ +* 最多调用 3 * 10ドル^4$ 次 get 和 put + +--- + +### 基本分析 + +LRU 是一种十分常见的页面置换算法。 + +将 LRU 翻译成大白话就是:**当不得不淘汰某些数据时(通常是容量已满),选择最久未被使用的数据进行淘汰。** + +**题目让我们实现一个容量固定的 `LRUCache` 。如果插入数据时,发现容器已满时,则先按照 LRU 规则淘汰一个数据,再将新数据插入,其中「插入」和「查询」都算作一次"使用"。** + +可以通过 🌰 来理解,假设我们有容量为 2ドル$ 的 `LRUCache` 和 测试键值对 `[`1-1`,`2-2`,`3-3`]` ,将其按照顺序进行插入 & 查询: +* 插入 `1-1`,此时最新的使用数据为 `1-1` +* 插入 `2-2`,此时最新使用数据变为 `2-2` +* 查询 `1-1`,此时最新使用数据为 `1-1` +* 插入 `3-3`,由于容器已经达到容量,需要先淘汰已有数据才能插入,这时候会淘汰 `2-2`,`3-3` 成为最新使用数据 + +键值对存储方面,我们可以使用「哈希表」来确保插入和查询的复杂度为 $O(1)$。 + +另外我们还需要额外维护一个「使用顺序」序列。 + +我们期望当「新数据被插入」或「发生键值对查询」时,能够将当前键值对放到序列头部,这样当触发 LRU 淘汰时,只需要从序列尾部进行数据删除即可。 + +**期望在 $O(1)$ 复杂度内调整某个节点在序列中的位置,很自然想到双向链表。** + +---- + +### 双向链表 + +具体的,我们使用哈希表来存储「键值对」,键值对的键作为哈希表的 Key,而哈希表的 Value 则使用我们自己封装的 `Node` 类,`Node` 同时作为双向链表的节点。 + +* 插入:检查当前键值对是否已经存在于哈希表: + * 如果存在,则更新键值对,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + * 如果不存在,则检查哈希表容量是否已经达到容量: + * 没达到容量:插入哈希表,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + * 已达到容量:先从链表尾部找到待删除元素进行删除(`delete` 操作),然后再插入哈希表,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) +* 查询:如果没在哈希表中找到该 Key,直接返回 $-1$;如果存在该 Key,则将对应的值返回,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + +一些细节: + +* 为了减少双向链表左右节点的「判空」操作,我们预先建立两个「哨兵」节点 `head` 和 `tail`。 + +代码: +```Java [] +class LRUCache { + class Node { + int k, v; + Node l, r; + Node(int _k, int _v) { + k = _k; + v = _v; + } + } + int n; + Node head, tail; + Map map; + public LRUCache(int capacity) { + n = capacity; + map = new HashMap(); + head = new Node(-1, -1); + tail = new Node(-1, -1); + head.r = tail; + tail.l = head; + } + + public int get(int key) { + if (map.containsKey(key)) { + Node node = map.get(key); + refresh(node); + return node.v; + } + return -1; + } + + public void put(int key, int value) { + Node node = null; + if (map.containsKey(key)) { + node = map.get(key); + node.v = value; + } else { + if (map.size() == n) { + Node del = tail.l; + map.remove(del.k); + delete(del); + } + node = new Node(key, value); + map.put(key, node); + } + refresh(node); + } + + // refresh 操作分两步: + // 1. 先将当前节点从双向链表中删除(如果该节点本身存在于双向链表中的话) + // 2. 将当前节点添加到双向链表头部 + void refresh(Node node) { + delete(node); + node.r = head.r; + node.l = head; + head.r.l = node; + head.r = node; + } + + // delete 操作:将当前节点从双向链表中移除 + // 由于我们预先建立 head 和 tail 两位哨兵,因此如果 node.l 不为空,则代表了 node 本身存在于双向链表(不是新节点) + void delete(Node node) { + if (node.l != null) { + Node left = node.l; + left.r = node.r; + node.r.l = left; + } + } +} +``` +* 时间复杂度:各操作均为 $O(1)$ +* 空间复杂度:$O(n)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.146` 篇,系列开始于 2021年01月01日,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 diff --git "a/LeetCode/1741-1750/1744. 344円275円240円350円203円275円345円234円250円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円351円202円243円345円244円251円345円220円203円345円210円260円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円347円263円226円346円236円234円345円220円227円357円274円237円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/1741-1750/1744. 344円275円240円350円203円275円345円234円250円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円351円202円243円345円244円251円345円220円203円345円210円260円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円347円263円226円346円236円234円345円220円227円357円274円237円357円274円210円344円270円255円347円255円211円357円274円211円.md" new file mode 100644 index 00000000..089f828c --- /dev/null +++ "b/LeetCode/1741-1750/1744. 344円275円240円350円203円275円345円234円250円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円351円202円243円345円244円251円345円220円203円345円210円260円344円275円240円346円234円200円345円226円234円346円254円242円347円232円204円347円263円226円346円236円234円345円220円227円357円274円237円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -0,0 +1,108 @@ +### 题目描述 + +这是 LeetCode 上的 **[1744. 你能在你最喜欢的那天吃到你最喜欢的糖果吗?](https://leetcode-cn.com/problems/can-you-eat-your-favorite-candy-on-your-favorite-day/solution/gong-shui-san-xie-qian-zhui-he-qiu-jie-c-b38y/)** ,难度为 **中等**。 + +Tag : 「前缀和」 + + + +给你一个下标从 0 开始的正整数数组 candiesCount ,其中 candiesCount[i] 表示你拥有的第 i 类糖果的数目。同时给你一个二维数组 queries ,其中 queries[i] = [favoriteTypei, favoriteDayi, dailyCapi] 。 + +你按照如下规则进行一场游戏: + +* 你从第 0 天开始吃糖果。 +* 你在吃完 所有 第 i - 1 类糖果之前,不能 吃任何一颗第 i 类糖果。 +* 在吃完所有糖果之前,你必须每天 至少 吃 一颗 糖果。 + +请你构建一个布尔型数组 answer ,满足 answer.length == queries.length 。answer[i] 为 true 的条件是:在每天吃 不超过 dailyCapi 颗糖果的前提下,你可以在第 favoriteDayi 天吃到第 favoriteTypei 类糖果;否则 answer[i] 为 false 。注意,只要满足上面 3 条规则中的第二条规则,你就可以在同一天吃不同类型的糖果。 + +请你返回得到的数组 answer 。 + + + +示例 1: +``` +输入:candiesCount = [7,4,5,3,8], queries = [[0,2,2],[4,2,4],[2,13,1000000000]] +输出:[true,false,true] +提示: +1- 在第 0 天吃 2 颗糖果(类型 0),第 1 天吃 2 颗糖果(类型 0),第 2 天你可以吃到类型 0 的糖果。 +2- 每天你最多吃 4 颗糖果。即使第 0 天吃 4 颗糖果(类型 0),第 1 天吃 4 颗糖果(类型 0 和类型 1),你也没办法在第 2 天吃到类型 4 的糖果。换言之,你没法在每天吃 4 颗糖果的限制下在第 2 天吃到第 4 类糖果。 +3- 如果你每天吃 1 颗糖果,你可以在第 13 天吃到类型 2 的糖果。 +``` +示例 2: +``` +输入:candiesCount = [5,2,6,4,1], queries = [[3,1,2],[4,10,3],[3,10,100],[4,100,30],[1,3,1]] +输出:[false,true,true,false,false] +``` + +提示: +* 1 <= candiesCount.length <= 10ドル^5$ +* 1 <= candiesCount[i] <= 10ドル^5$ +* 1 <= queries.length <= 10ドル^5$ +* queries[i].length == 3 +* 0 <= favoriteTypei < candiesCount.length +* 0 <= favoriteDayi <= 10ドル^9$ +* 1 <= dailyCapi <= 10ドル^9$ + +--- + +### 基本分析 + +根据题意,在处理某个询问时,每天的吃糖数量为 $[1, queries[i][2]],ドル因此我们可以计算出「最早/最晚」吃到第 $queries[i][0]$ 类糖果的时间,然后判断 $queries[i][1]$ 是否落在范围内,若落在范围内返回则有 $ans[i]$ 为 `True`,否则为 `False`。 + +--- + +### 前缀和 + +问题转换为如何快速求得「最早/最晚」吃到第 $queries[i][0]$ 类糖果的时间。 + +我们需要先预处理出 $candiesCount$ 的前缀和数组 $sum$(下标从 1ドル$ 开始),方便快速求得第 $i$ 类糖果之前有多少糖果。 + +为了方便,在处理某个询问时,我们令 $t = queries[i][0],d = queries[i][1] + 1,c = queries[i][2]$。其中 $d = queries[i][1] + 1$ 是因为题目天数是从 0ドル$ 开始计算,而我们的计算是从 1ドル$ 开始。 + +然后计算「最早/最晚」吃到第 $t$ 类糖果的时间: + +* 最早时间(第一颗 $t$ 类糖的最早时间):当以最大速率 $c$ 吃糖时,可以在最早时间内吃到糖。时间为吃掉第 $t$ 类糖果 **前面** 的所有糖果的时间(下取整)加 1ドル$ : + +$$ +\left \lfloor \frac{sum[t]}{c} \right \rfloor + 1 +$$ + +* 最晚时间(最后一颗 $t$ 类糖的最晚时间):当以最小速率 1ドル$ 吃糖时,可以计算出最晚吃糖时间。时间为吃掉所有 $t$ 类糖的时间: + +$$ +sum[t + 1] +$$ + +代码: +```Java [] +class Solution { + public boolean[] canEat(int[] cs, int[][] qs) { + int n = qs.length, m = cs.length; + boolean[] ans = new boolean[n]; + long[] sum = new long[m + 1]; + for (int i = 1; i <= m; i++) sum[i] = sum[i - 1] + cs[i - 1]; + for (int i = 0; i < n; i++) { + int t = qs[i][0], d = qs[i][1] + 1, c = qs[i][2]; + long a = sum[t] / c + 1, b = sum[t + 1]; + ans[i] = a <= d && d <= b; + } + return ans; + } +} +``` +* 时间复杂度:`cs` 数组的长度为 `n`,`qs` 数组的长度为 `m`。预处理前缀和的复杂度为 $O(n)$;处理每个询问的复杂度为 $O(1),ドル共有 $m$ 个询问,复杂度为 $O(m)$。整体复杂度为 $O(\max(n, m))$ +* 空间复杂度:$O(n)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.1744` 篇,系列开始于 2021/01/01,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 + diff --git "a/LeetCode/1781-1790/1786. 344円273円216円347円254円254円344円270円200円344円270円252円350円212円202円347円202円271円345円207円272円345円217円221円345円210円260円346円234円200円345円220円216円344円270円200円344円270円252円350円212円202円347円202円271円347円232円204円345円217円227円351円231円220円350円267円257円345円276円204円346円225円260円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/1781-1790/1786. 344円273円216円347円254円254円344円270円200円344円270円252円350円212円202円347円202円271円345円207円272円345円217円221円345円210円260円346円234円200円345円220円216円344円270円200円344円270円252円350円212円202円347円202円271円347円232円204円345円217円227円351円231円220円350円267円257円345円276円204円346円225円260円357円274円210円344円270円255円347円255円211円357円274円211円.md" index 8229af0d..9ecc2b44 100644 --- "a/LeetCode/1781-1790/1786. 344円273円216円347円254円254円344円270円200円344円270円252円350円212円202円347円202円271円345円207円272円345円217円221円345円210円260円346円234円200円345円220円216円344円270円200円344円270円252円350円212円202円347円202円271円347円232円204円345円217円227円351円231円220円350円267円257円345円276円204円346円225円260円357円274円210円344円270円255円347円255円211円357円274円211円.md" +++ "b/LeetCode/1781-1790/1786. 344円273円216円347円254円254円344円270円200円344円270円252円350円212円202円347円202円271円345円207円272円345円217円221円345円210円260円346円234円200円345円220円216円344円270円200円344円270円252円350円212円202円347円202円271円347円232円204円345円217円227円351円231円220円350円267円257円345円276円204円346円225円260円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -49,7 +49,7 @@ Tag : 「图论最短路」、「线性 DP」 --- -### 堆优化 Dijkstra + 动态规划解法 +### 堆优化 Dijkstra + 动态规划 n 为点的数量,m 为边的数量。 @@ -155,7 +155,7 @@ class Solution { 在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 -为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode。 +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 diff --git "a/LeetCode/1781-1790/1787. 344円275円277円346円211円200円346円234円211円345円214円272円351円227円264円347円232円204円345円274円202円346円210円226円347円273円223円346円236円234円344円270円272円351円233円266円357円274円210円345円233円260円351円232円276円357円274円211円.md" "b/LeetCode/1781-1790/1787. 344円275円277円346円211円200円346円234円211円345円214円272円351円227円264円347円232円204円345円274円202円346円210円226円347円273円223円346円236円234円344円270円272円351円233円266円357円274円210円345円233円260円351円232円276円357円274円211円.md" index 65347455..507e9942 100644 --- "a/LeetCode/1781-1790/1787. 344円275円277円346円211円200円346円234円211円345円214円272円351円227円264円347円232円204円345円274円202円346円210円226円347円273円223円346円236円234円344円270円272円351円233円266円357円274円210円345円233円260円351円232円276円357円274円211円.md" +++ "b/LeetCode/1781-1790/1787. 344円275円277円346円211円200円346円234円211円345円214円272円351円227円264円347円232円204円345円274円202円346円210円226円347円273円223円346円236円234円344円270円272円351円233円266円357円274円210円345円233円260円351円232円276円357円274円211円.md" @@ -155,7 +155,7 @@ class Solution { 在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 -为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode。 +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 diff --git "a/LeetCode/231-240/231. 2 347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" "b/LeetCode/231-240/231. 2 347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" new file mode 100644 index 00000000..6351e71c --- /dev/null +++ "b/LeetCode/231-240/231. 2 347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" @@ -0,0 +1,99 @@ +### 题目描述 + +这是 LeetCode 上的 **[231. 2 的幂](https://leetcode-cn.com/problems/power-of-two/solution/gong-shui-san-xie-2-de-mi-by-ac_oier-qm6e/)** ,难度为 **简单**。 + +Tag : 「数学」、「位运算」 + + + + +给你一个整数 n,请你判断该整数是否是 2 的幂次方。如果是,返回 true ;否则,返回 false 。 + +如果存在一个整数 x 使得 n == 2ドル^x$ ,则认为 n 是 2 的幂次方。 + +示例 1: +``` +输入:n = 1 +输出:true +解释:20 = 1 +``` +示例 2: +``` +输入:n = 16 +输出:true +解释:24 = 16 +``` +示例 3: +``` +输入:n = 3 +输出:false +``` +示例 4: +``` +输入:n = 4 +输出:true +``` +示例 5: +``` +输入:n = 5 +输出:false +``` + +提示: +* -2ドル^{31}$ <= n <= 2ドル^{31}$ - 1 + + +进阶:你能够不使用循环/递归解决此问题吗? + +--- + +### 朴素做法 + +首先小于等于 0ドル$ 的数必然不是,1ドル$ 必然是。 + +在处理完这些边界之后,尝试将 $n$ 除干净,如果最后剩余数值为 1ドル$ 则说明开始是 2ドル$ 的幂。 + +代码: +```Java [] +class Solution { + public boolean isPowerOfTwo(int n) { + if (n <= 0) return false; + while (n % 2 == 0) n /= 2; + return n == 1; + } +} +``` +* 时间复杂度:$O(\log{n})$ +* 空间复杂度:$O(1)$ + +--- + +### lowbit + +熟悉树状数组的同学都知道,`lowbit` 可以快速求得 `x` 二进制表示中最低位 `1` 表示的值。 + +如果一个数 $n$ 是 2ドル$ 的幂,那么有 `lowbit(n) = n` 的性质(2ドル$ 的幂的二进制表示中必然是最高位为 1ドル,ドル低位为 0ドル$)。 + +代码; +```Java [] +class Solution { + public boolean isPowerOfTwo(int n) { + return n> 0 && (n & -n) == n; + } +} +``` +* 时间复杂度:$O(1)$ +* 空间复杂度:$O(1)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.231` 篇,系列开始于 2021年01月01日,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 + diff --git "a/LeetCode/341-350/342. 4347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" "b/LeetCode/341-350/342. 4347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" new file mode 100644 index 00000000..6e6f9ce4 --- /dev/null +++ "b/LeetCode/341-350/342. 4347円232円204円345円271円202円357円274円210円347円256円200円345円215円225円357円274円211円.md" @@ -0,0 +1,101 @@ +### 题目描述 + +这是 LeetCode 上的 **[342. 4的幂](https://leetcode-cn.com/problems/power-of-four/solution/gong-shui-san-xie-zhuan-hua-wei-2-de-mi-y21lq/)** ,难度为 **简单**。 + +Tag : 「数学」、「位运算」 + + + + +给定一个整数,写一个函数来判断它是否是 4 的幂次方。如果是,返回 true ;否则,返回 false 。 + +整数 n 是 4 的幂次方需满足:存在整数 x 使得 n == 4ドル^x$ + +示例 1: +``` +输入:n = 16 +输出:true +``` +示例 2: +``` +输入:n = 5 +输出:false +``` +示例 3: +``` +输入:n = 1 +输出:true +``` + +提示: + +* -2ドル^{31}$ <= n <= 2ドル^{31}$ - 1 + + +进阶: + +你能不使用循环或者递归来完成本题吗? + + +--- + +### 基本分析 + +一个数 $n$ 如果是 4ドル$ 的幂,等价于 $n$ 为质因数只有 2ドル$ 的平方数。 + +因此我们可以将问题其转换:判断 $\sqrt{n}$ 是否为 2ドル$ 的幂。 + +判断某个数是否为 2ドル$ 的幂的分析在[(题解)231. 2 的幂](https://leetcode-cn.com/problems/power-of-two/solution/gong-shui-san-xie-2-de-mi-by-ac_oier-qm6e/) 这里。 + +--- + +### sqrt + lowbit + +我们可以先对 $n$ 执行 `sqrt` 函数,然后应用 `lowbit` 函数快速判断 $\sqrt{n}$ 是否为 2ドル$ 的幂。 + +代码: +```Java [] +class Solution { + public boolean isPowerOfFour(int n) { + if (n <= 0) return false; + int x = (int)Math.sqrt(n); + return x * x == n && (x & -x) == x; + } +} +``` +```Java [] +class Solution { + public boolean isPowerOfFour(int n) { + if (n <= 0) return false; + int x = getVal(n); + return x * x == n && (x & -x) == x; + } + int getVal(int n) { + long l = 0, r = n; + while (l < r) { + long mid = l + r>> 1; + if (mid * mid>= n) { + r = mid; + } else { + l = mid + 1; + } + } + return (int)r; + } +} +``` +* 时间复杂度:复杂度取决于内置函数 `sqrt`。一个简单的 `sqrt` 的实现接近于 P2 的代码。复杂度为 $O(\log{n})$ +* 空间复杂度:$O(1)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.342` 篇,系列开始于 2021年01月01日,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 + diff --git "a/LeetCode/471-480/477. 346円261円211円346円230円216円350円267円235円347円246円273円346円200円273円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/471-480/477. 346円261円211円346円230円216円350円267円235円347円246円273円346円200円273円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" new file mode 100644 index 00000000..a76417e0 --- /dev/null +++ "b/LeetCode/471-480/477. 346円261円211円346円230円216円350円267円235円347円246円273円346円200円273円345円222円214円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -0,0 +1,87 @@ +### 题目描述 + +这是 LeetCode 上的 **[477. 汉明距离总和](https://leetcode-cn.com/problems/total-hamming-distance/solution/gong-shui-san-xie-ying-yong-cheng-fa-yua-g21t/)** ,难度为 **中等**。 + +Tag : 「位运算」、「数学」 + + + +两个整数的 汉明距离 指的是这两个数字的二进制数对应位不同的数量。 + +给你一个整数数组 nums,请你计算并返回 nums 中任意两个数之间汉明距离的总和。 + + + +示例 1: +``` +输入:nums = [4,14,2] +输出:6 +解释:在二进制表示中,4 表示为 0100 ,14 表示为 1110 ,2表示为 0010 。(这样表示是为了体现后四位之间关系) +所以答案为: +HammingDistance(4, 14) + HammingDistance(4, 2) + HammingDistance(14, 2) = 2 + 2 + 2 = 6 +``` +示例 2: +``` +输入:nums = [4,14,4] +输出:4 +``` + +提示: +``` +1 <= nums.length <= 10ドル^5$ +0 <= nums[i] <= 10ドル^9$ +``` + +--- + +### 按位统计 + +我们知道,汉明距离为两数二进制表示中不同位的个数,同时每位的统计是相互独立的。 + +即最终的答案为 $\sum_{x = 0}^{31} calc(x),ドル其中 $calc$ 函数为求得所有数二进制表示中的某一位 $x$ 所产生的不同位的个数。 + +我们考虑某个 $cacl(x)$ 如何求得: + +事实上,对于某个 `nums[i]` 我们只关心在 `nums` 中有多少数的第 $x$ 位的与其不同,而不关心具体是哪些数与其不同,同时二进制表示中非 0ドル$ 即 1ドル$。 + +**这指导我们可以建立两个集合 $s0$ 和 $s1,ドル分别统计出 `nums` 中所有数的第 $x$ 位中 0ドル$ 的个数和 1ドル$ 的个数,集合中的每次计数代表了 `nums` 中的某一元素,根据所在集合的不同代表了其第 $x$ 位的值。那么要找到在 `nums` 中有多少数与某一个数的第 $x$ 位不同,只需要读取另外一个集合的元素个数即可,变成了 $O(1)$ 操作。那么要求得「第 $x$ 位所有不同数」的对数的个数,只需要应用乘法原理,将两者元素个数相乘即可。** + +![image.png](https://pic.leetcode-cn.com/1622166123-MiinFf-image.png) + +前面说到每位的统计是相对独立的,因此只要对「每一位」都应用上述操作,并把「每一位」的结果累加即是最终答案。 + +代码: +```Java [] +class Solution { + public int totalHammingDistance(int[] nums) { + int ans = 0; + for (int x = 31; x>= 0; x--) { + int s0 = 0, s1 = 0; + for (int u : nums) { + if (((u>> x) & 1) == 1) { + s1++; + } else { + s0++; + } + } + ans += s0 * s1; + } + return ans; + } +} +``` +* 时间复杂度:$O(C * n),ドル$C$ 固定为 32ドル$ +* 空间复杂度:$O(1)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.477` 篇,系列开始于 2021年01月01日,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 + diff --git "a/LeetCode/351円235円242円350円257円225円351円242円230円/351円235円242円350円257円225円351円242円230円 16.25. LRU 347円274円223円345円255円230円357円274円210円344円270円255円347円255円211円357円274円211円.md" "b/LeetCode/351円235円242円350円257円225円351円242円230円/351円235円242円350円257円225円351円242円230円 16.25. LRU 347円274円223円345円255円230円357円274円210円344円270円255円347円255円211円357円274円211円.md" new file mode 100644 index 00000000..bd11c572 --- /dev/null +++ "b/LeetCode/351円235円242円350円257円225円351円242円230円/351円235円242円350円257円225円351円242円230円 16.25. LRU 347円274円223円345円255円230円357円274円210円344円270円255円347円255円211円357円274円211円.md" @@ -0,0 +1,172 @@ +### 题目描述 + +这是 LeetCode 上的 **[面试题 16.25. LRU 缓存](https://leetcode-cn.com/problems/lru-cache-lcci/solution/gong-shui-san-xie-she-ji-shu-ju-jie-gou-k0iwg/))** ,难度为 **中等**。 + +Tag : 「设计」、「链表」、「哈希表」 + + + + +运用你所掌握的数据结构,设计和实现一个 LRU (最近最少使用) 缓存机制 。 +实现 LRUCache 类: + +* LRUCache(int capacity) 以正整数作为容量 capacity 初始化 LRU 缓存 +* int get(int key) 如果关键字 key 存在于缓存中,则返回关键字的值,否则返回 -1 。 +* void put(int key, int value) 如果关键字已经存在,则变更其数据值;如果关键字不存在,则插入该组「关键字-值」。当缓存容量达到上限时,它应该在写入新数据之前删除最久未使用的数据值,从而为新的数据值留出空间。 + +进阶:你是否可以在 $O(1)$ 时间复杂度内完成这两种操作? + +示例: +``` +输入 +["LRUCache", "put", "put", "get", "put", "get", "put", "get", "get", "get"] +[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]] +输出 +[null, null, null, 1, null, -1, null, -1, 3, 4] + +解释 +LRUCache lRUCache = new LRUCache(2); +lRUCache.put(1, 1); // 缓存是 {1=1} +lRUCache.put(2, 2); // 缓存是 {1=1, 2=2} +lRUCache.get(1); // 返回 1 +lRUCache.put(3, 3); // 该操作会使得关键字 2 作废,缓存是 {1=1, 3=3} +lRUCache.get(2); // 返回 -1 (未找到) +lRUCache.put(4, 4); // 该操作会使得关键字 1 作废,缓存是 {4=4, 3=3} +lRUCache.get(1); // 返回 -1 (未找到) +lRUCache.get(3); // 返回 3 +lRUCache.get(4); // 返回 4 +``` + +提示: +* 1 <= capacity <= 3000 +* 0 <= key <= 3000 +* 0 <= value <= 10ドル^4$ +* 最多调用 3 * 10ドル^4$ 次 get 和 put + +--- + +### 基本分析 + +LRU 是一种十分常见的页面置换算法。 + +将 LRU 翻译成大白话就是:**当不得不淘汰某些数据时(通常是容量已满),选择最久未被使用的数据进行淘汰。** + +**题目让我们实现一个容量固定的 `LRUCache` 。如果插入数据时,发现容器已满时,则先按照 LRU 规则淘汰一个数据,再将新数据插入,其中「插入」和「查询」都算作一次"使用"。** + +可以通过 🌰 来理解,假设我们有容量为 2ドル$ 的 `LRUCache` 和 测试键值对 `[`1-1`,`2-2`,`3-3`]` ,将其按照顺序进行插入 & 查询: +* 插入 `1-1`,此时最新的使用数据为 `1-1` +* 插入 `2-2`,此时最新使用数据变为 `2-2` +* 查询 `1-1`,此时最新使用数据为 `1-1` +* 插入 `3-3`,由于容器已经达到容量,需要先淘汰已有数据才能插入,这时候会淘汰 `2-2`,`3-3` 成为最新使用数据 + +键值对存储方面,我们可以使用「哈希表」来确保插入和查询的复杂度为 $O(1)$。 + +另外我们还需要额外维护一个「使用顺序」序列。 + +我们期望当「新数据被插入」或「发生键值对查询」时,能够将当前键值对放到序列头部,这样当触发 LRU 淘汰时,只需要从序列尾部进行数据删除即可。 + +**期望在 $O(1)$ 复杂度内调整某个节点在序列中的位置,很自然想到双向链表。** + +---- + +### 双向链表 + +具体的,我们使用哈希表来存储「键值对」,键值对的键作为哈希表的 Key,而哈希表的 Value 则使用我们自己封装的 `Node` 类,`Node` 同时作为双向链表的节点。 + +* 插入:检查当前键值对是否已经存在于哈希表: + * 如果存在,则更新键值对,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + * 如果不存在,则检查哈希表容量是否已经达到容量: + * 没达到容量:插入哈希表,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + * 已达到容量:先从链表尾部找到待删除元素进行删除(`delete` 操作),然后再插入哈希表,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) +* 查询:如果没在哈希表中找到该 Key,直接返回 $-1$;如果存在该 Key,则将对应的值返回,并将当前键值对所对应的 `Node` 节点调整到链表头部(`refresh` 操作) + +一些细节: + +* 为了减少双向链表左右节点的「判空」操作,我们预先建立两个「哨兵」节点 `head` 和 `tail`。 + +代码: +```Java [] +class LRUCache { + class Node { + int k, v; + Node l, r; + Node(int _k, int _v) { + k = _k; + v = _v; + } + } + int n; + Node head, tail; + Map map; + public LRUCache(int capacity) { + n = capacity; + map = new HashMap(); + head = new Node(-1, -1); + tail = new Node(-1, -1); + head.r = tail; + tail.l = head; + } + + public int get(int key) { + if (map.containsKey(key)) { + Node node = map.get(key); + refresh(node); + return node.v; + } + return -1; + } + + public void put(int key, int value) { + Node node = null; + if (map.containsKey(key)) { + node = map.get(key); + node.v = value; + } else { + if (map.size() == n) { + Node del = tail.l; + map.remove(del.k); + delete(del); + } + node = new Node(key, value); + map.put(key, node); + } + refresh(node); + } + + // refresh 操作分两步: + // 1. 先将当前节点从双向链表中删除(如果该节点本身存在于双向链表中的话) + // 2. 将当前节点添加到双向链表头部 + void refresh(Node node) { + delete(node); + node.r = head.r; + node.l = head; + head.r.l = node; + head.r = node; + } + + // delete 操作:将当前节点从双向链表中移除 + // 由于我们预先建立 head 和 tail 两位哨兵,因此如果 node.l 不为空,则代表了 node 本身存在于双向链表(不是新节点) + void delete(Node node) { + if (node.l != null) { + Node left = node.l; + left.r = node.r; + node.r.l = left; + } + } +} +``` +* 时间复杂度:各操作均为 $O(1)$ +* 空间复杂度:$O(n)$ + +--- + +### 最后 + +这是我们「刷穿 LeetCode」系列文章的第 `No.面试题 16.25` 篇,系列开始于 2021年01月01日,截止于起始日 LeetCode 上共有 1916 道题目,部分是有锁题,我们将先将所有不带锁的题目刷完。 + +在这个系列文章里面,除了讲解解题思路以外,还会尽可能给出最为简洁的代码。如果涉及通解还会相应的代码模板。 + +为了方便各位同学能够电脑上进行调试和提交代码,我建立了相关的仓库:https://github.com/SharingSource/LogicStack-LeetCode 。 + +在仓库地址里,你可以看到系列文章的题解链接、系列文章的相应代码、LeetCode 原题链接和其他优选题解。 +

AltStyle によって変換されたページ (->オリジナル) /