feat: add new lc problems (#4379)

This commit is contained in:
Libin YANG 2025-04-30 08:47:49 +08:00 committed by GitHub
parent 43b825f985
commit 7fb7d02919
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
160 changed files with 3145 additions and 87 deletions

View File

@ -17,7 +17,9 @@ tags:
<!-- description:start -->
<p>给你两个字符串 <code>s</code><strong> </strong><code>t</code> ,统计并返回在 <code>s</code><strong>子序列</strong><code>t</code> 出现的个数,结果需要对&nbsp;10<sup>9</sup> + 7 取模。</p>
<p>给你两个字符串 <code>s</code><strong> </strong><code>t</code> ,统计并返回在 <code>s</code><strong>子序列</strong><code>t</code> 出现的个数。</p>
<p>测试用例保证结果在 32 位有符号整数范围内。</p>
<p>&nbsp;</p>

View File

@ -25,13 +25,13 @@ tags:
| id | int |
| salary | int |
+-------------+------+
在 SQL 中,id 是该表的主键。
id 是该表的主键(列中的值互不相同)
该表的每一行都包含有关员工工资的信息。
</pre>
<p>&nbsp;</p>
<p>查询&nbsp;<code>Employee</code> 表中第 <code>n</code> 高的工资。如果没有第 <code>n</code> 个最高工资,查询结果应该为&nbsp;<code>null</code></p>
<p>编写一个解决方案查询&nbsp;<code>Employee</code> 表中第 <code>n</code> 高的&nbsp;<strong>不同</strong> 工资。如果少于&nbsp;<code>n</code> 个不同工资,查询结果应该为&nbsp;<code>null</code></p>
<p>查询结果格式如下所示。</p>

View File

@ -31,7 +31,7 @@ Each row of this table contains information about the salary of an employee.
<p>&nbsp;</p>
<p>Write a solution to find the <code>n<sup>th</sup></code> highest salary from the <code>Employee</code> table. If there is no <code>n<sup>th</sup></code> highest salary, return&nbsp;<code>null</code>.</p>
<p>Write a solution to find the <code>n<sup>th</sup></code> highest <strong>distinct</strong> salary from the <code>Employee</code> table. If there are less than <code>n</code> distinct salaries, return&nbsp;<code>null</code>.</p>
<p>The result format is in the following example.</p>

View File

@ -17,7 +17,7 @@ tags:
<!-- description:start -->
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数,<code>citations</code> 已经按照&nbsp;<strong>序排列&nbsp;</strong>。计算并返回该研究者的 h<strong><em>&nbsp;</em></strong>指数。</p>
<p>给你一个整数数组 <code>citations</code> ,其中 <code>citations[i]</code> 表示研究者的第 <code>i</code> 篇论文被引用的次数,<code>citations</code> 已经按照&nbsp;<strong>非降序排列&nbsp;</strong>。计算并返回该研究者的 h<strong><em>&nbsp;</em></strong>指数。</p>
<p><a href="https://baike.baidu.com/item/h-index/3991452?fr=aladdin" target="_blank">h 指数的定义</a>h 代表“高引用次数”high citations一名科研人员的 <code>h</code> 指数是指他(她)的 <code>n</code> 篇论文中)<strong>至少&nbsp;</strong><code>h</code> 篇论文分别被引用了<strong>至少</strong> <code>h</code> 次。</p>

View File

@ -17,7 +17,7 @@ tags:
<!-- description:start -->
<p>Given an array of integers <code>citations</code> where <code>citations[i]</code> is the number of citations a researcher received for their <code>i<sup>th</sup></code> paper and <code>citations</code> is sorted in <strong>ascending order</strong>, return <em>the researcher&#39;s h-index</em>.</p>
<p>Given an array of integers <code>citations</code> where <code>citations[i]</code> is the number of citations a researcher received for their <code>i<sup>th</sup></code> paper and <code>citations</code> is sorted in <strong>non-descending order</strong>, return <em>the researcher&#39;s h-index</em>.</p>
<p>According to the <a href="https://en.wikipedia.org/wiki/H-index" target="_blank">definition of h-index on Wikipedia</a>: The h-index is defined as the maximum value of <code>h</code> such that the given researcher has published at least <code>h</code> papers that have each been cited at least <code>h</code> times.</p>

View File

@ -32,8 +32,6 @@ tags:
<p><strong>总旅行距离&nbsp;</strong>是朋友们家到聚会地点的距离之和。</p>
<p>使用 <strong>曼哈顿距离</strong>&nbsp;计算距离,其中距离 <code>(p1, p2) = |p2.x - p1.x | + | p2.y - p1.y |</code></p>
<p>&nbsp;</p>
<p><strong>示例&nbsp; 1</strong></p>

View File

@ -32,8 +32,6 @@ tags:
<p>The <strong>total travel distance</strong> is the sum of the distances between the houses of the friends and the meeting point.</p>
<p>The distance is calculated using <a href="http://en.wikipedia.org/wiki/Taxicab_geometry" target="_blank">Manhattan Distance</a>, where <code>distance(p1, p2) = |p2.x - p1.x| + |p2.y - p1.y|</code>.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0300-0399/0317.Shortest%20Distance%20from%20All%20Buildings/images/buildings-grid.jpg" style="width: 413px; height: 253px;" />

View File

@ -5,6 +5,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0689.Ma
tags:
- 数组
- 动态规划
- 前缀和
- 滑动窗口
---
<!-- problem:start -->

View File

@ -5,6 +5,8 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0600-0699/0689.Ma
tags:
- Array
- Dynamic Programming
- Prefix Sum
- Sliding Window
---
<!-- problem:start -->

View File

@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0700-0799/0759.Em
tags:
- 数组
- 排序
- 扫描线
- 堆(优先队列)
---

View File

@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0700-0799/0759.Em
tags:
- Array
- Sorting
- Line Sweep
- Heap (Priority Queue)
---

View File

@ -31,10 +31,10 @@ tags:
<strong>输入:</strong>answers = [1,1,2]
<strong>输出:</strong>5
<strong>解释:</strong>
两只回答了 "1" 的兔子可能有相同的颜色,设为红色。
两只回答了 "1" 的兔子可能有相同的颜色,设为红色。
之后回答了 "2" 的兔子不会是红色,否则他们的回答会相互矛盾。
设回答了 "2" 的兔子为蓝色。
此外,森林中还应有另外 2 只蓝色兔子的回答没有包含在数组中。
设回答了 "2" 的兔子为蓝色。
此外,森林中还应有另外 2 只蓝色兔子的回答没有包含在数组中。
因此森林中兔子的最少数量是 5 只3 只回答的和 2 只没有回答的。
</pre>

View File

@ -21,7 +21,7 @@ tags:
<p>有一个有 <code>n</code> 个节点的有向图,节点按 <code>0</code><code>n - 1</code> 编号。图由一个 <strong>索引从 0 开始</strong> 的 2D 整数数组&nbsp;<code>graph</code>表示,&nbsp;<code>graph[i]</code>是与节点 <code>i</code> 相邻的节点的整数数组,这意味着从节点 <code>i</code>&nbsp;<code>graph[i]</code>中的每个节点都有一条边。</p>
<p>如果一个节点没有连出的有向边,则该节点是 <strong>终端节点</strong> 。如果从该节点开始的所有可能路径都通向 <strong>终端节点</strong> ,则该节点为 <strong>安全节点</strong> </p>
<p>如果一个节点没有连出的有向边,则该节点是 <strong>终端节点</strong> 。如果从该节点开始的所有可能路径都通向 <strong>终端节点</strong> ,则该节点为 <strong>终端节点</strong>(或另一个安全节点)</p>
<p>返回一个由图中所有 <strong>安全节点</strong> 组成的数组作为答案。答案数组中的元素应当按 <strong>升序</strong> 排列。</p>

View File

@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0900-0999/0949.La
tags:
- 数组
- 字符串
- 回溯
- 枚举
---

View File

@ -5,6 +5,7 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/0900-0999/0949.La
tags:
- Array
- String
- Backtracking
- Enumeration
---

View File

@ -7,8 +7,8 @@ source: 第 135 场周赛 Q4
tags:
- 数组
- 数学
- 双指针
- 排序
- 滑动窗口
---
<!-- problem:start -->

View File

@ -7,8 +7,8 @@ source: Weekly Contest 135 Q4
tags:
- Array
- Math
- Two Pointers
- Sorting
- Sliding Window
---
<!-- problem:start -->

View File

@ -34,7 +34,7 @@ Each row of this table shows a sale on the product product_id in a certain year.
Note that the price is per unit.
</pre>
<p>&nbsp;</p>
<p> </p>
<p>Table: <code>Product</code></p>
@ -49,13 +49,13 @@ product_id is the primary key (column with unique values) of this table.
Each row of this table indicates the product name of each product.
</pre>
<p>&nbsp;</p>
<p> </p>
<p>Write a solution to select&nbsp;the <strong>product id</strong>, <strong>year</strong>, <strong>quantity</strong>, and <strong>price</strong> for the <strong>first year</strong> of every product sold.</p>
<p>Write a solution to select the <strong>product id</strong>, <strong>year</strong>, <strong>quantity</strong>, and <strong>price</strong> for the <strong>first year</strong> of every product sold. If any product is bought multiple times in its first year, return all sales separately.</p>
<p>Return the resulting table in <strong>any order</strong>.</p>
<p>The&nbsp;result format is in the following example.</p>
<p>The result format is in the following example.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

View File

@ -34,9 +34,9 @@ tags:
<p>&nbsp;</p>
<p>请查询出所有浏览过自己文章的作者</p>
<p>请查询出所有浏览过自己文章的作者</p>
<p>结果按照 <code>id</code> 升序排列。</p>
<p>结果按照作者的&nbsp;<code>id</code> 升序排列。</p>
<p>查询结果的格式如下所示:</p>

View File

@ -19,7 +19,7 @@ tags:
<!-- description:start -->
<p>给你一个整数数组&nbsp;<code>nums</code>,请你返回其中位数为&nbsp;<strong>偶数</strong>&nbsp;的数字的个数。</p>
<p>给你一个整数数组&nbsp;<code>nums</code>,请你返回其中包含&nbsp;<strong>偶数</strong>&nbsp;个数位的数字的个数。</p>
<p>&nbsp;</p>

View File

@ -19,15 +19,18 @@ tags:
<!-- description:start -->
<p>一个整数 <code>n</code>&nbsp;。请你先求出从 <code>1</code>&nbsp;<code>n</code> 的每个整数 10 进制表示下的数位和(每一位上的数字相加),然后把数位和相等的数字放到同一个组中</p>
<p>一个整数 <code>n</code>&nbsp;</p>
<p>请你统计每个组中的数字数目,并返回数字数目并列最多的组有多少个。</p>
<p>我们需要根据数字的数位和将 <code>1</code><code>n</code> 的数字分组。例如,数字 14 和 5 属于 <strong>同一</strong>&nbsp;组,而数字 13 和 3 属于 <strong>不同</strong>&nbsp;组。</p>
<p>返回最大组的数字数量,即元素数量 <strong>最多</strong> 的组。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>n = 13
<pre>
<strong>输入:</strong>n = 13
<strong>输出:</strong>4
<strong>解释:</strong>总共有 9 个组,将 1 到 13 按数位求和后这些组分别是:
[1,10][2,11][3,12][4,13][5][6][7][8][9]。总共有 4 个组拥有的数字并列最多。
@ -35,29 +38,18 @@ tags:
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>n = 2
<pre>
<strong>输入:</strong>n = 2
<strong>输出:</strong>2
<strong>解释:</strong>总共有 2 个大小为 1 的组 [1][2]。
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>n = 15
<strong>输出:</strong>6
</pre>
<p><strong>示例 4</strong></p>
<pre><strong>输入:</strong>n = 24
<strong>输出:</strong>5
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 10^4</code></li>
<li><code>1 &lt;= n &lt;= 10<sup>4</sup></code></li>
</ul>
<!-- description:end -->

View File

@ -21,9 +21,9 @@ tags:
<p>You are given an integer <code>n</code>.</p>
<p>Each number from <code>1</code> to <code>n</code> is grouped according to the sum of its digits.</p>
<p>We need to group the numbers from <code>1</code> to <code>n</code> according to the sum of its digits. For example, the numbers 14 and 5 belong to the <strong>same</strong> group, whereas 13 and 3 belong to <strong>different</strong> groups.</p>
<p>Return <em>the number of groups that have the largest size</em>.</p>
<p>Return the number of groups that have the largest size, i.e. the <strong>maximum</strong> number of elements.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

View File

@ -7,6 +7,7 @@ source: 第 183 场周赛 Q2
tags:
- 位运算
- 字符串
- 模拟
---
<!-- problem:start -->

View File

@ -7,6 +7,7 @@ source: Weekly Contest 183 Q2
tags:
- Bit Manipulation
- String
- Simulation
---
<!-- problem:start -->

View File

@ -8,6 +8,7 @@ tags:
- 数组
- 双指针
- 二分查找
- 前缀和
- 排序
---

View File

@ -8,6 +8,7 @@ tags:
- Array
- Two Pointers
- Binary Search
- Prefix Sum
- Sorting
---

View File

@ -5,8 +5,9 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/1700-1799/1778.Sh
tags:
- 深度优先搜索
- 广度优先搜索
-
- 数组
- 交互
- 矩阵
---
<!-- problem:start -->

View File

@ -5,8 +5,9 @@ edit_url: https://github.com/doocs/leetcode/edit/main/solution/1700-1799/1778.Sh
tags:
- Depth-First Search
- Breadth-First Search
- Graph
- Array
- Interactive
- Matrix
---
<!-- problem:start -->

View File

@ -6,7 +6,10 @@ tags:
- 深度优先搜索
- 广度优先搜索
- 图
- 数组
- 交互
- 矩阵
- 最短路
- 堆(优先队列)
---

View File

@ -6,7 +6,10 @@ tags:
- Depth-First Search
- Breadth-First Search
- Graph
- Array
- Interactive
- Matrix
- Shortest Path
- Heap (Priority Queue)
---

View File

@ -36,7 +36,7 @@ tags:
<strong>Output:</strong> [[1,3],[4,6]]
<strong>Explanation:
</strong>For nums1, nums1[1] = 2 is present at index 0 of nums2, whereas nums1[0] = 1 and nums1[2] = 3 are not present in nums2. Therefore, answer[0] = [1,3].
For nums2, nums2[0] = 2 is present at index 1 of nums1, whereas nums2[1] = 4 and nums2[2] = 6 are not present in nums2. Therefore, answer[1] = [4,6].</pre>
For nums2, nums2[0] = 2 is present at index 1 of nums1, whereas nums2[1] = 4 and nums2[2] = 6 are not present in nums1. Therefore, answer[1] = [4,6].</pre>
<p><strong class="example">Example 2:</strong></p>

View File

@ -53,7 +53,7 @@ tags:
<strong>输出:</strong>11
<strong>解释:</strong>存在以下理想数组:
- 以 1 开头的数组9 个):
- 不含其他不同值1 个):[1,1,1,1,1]
- 不含其他不同值1 个):[1,1,1,1,1]
- 含一个不同值 24 个):[1,1,1,1,2], [1,1,1,2,2], [1,1,2,2,2], [1,2,2,2,2]
- 含一个不同值 34 个):[1,1,1,1,3], [1,1,1,3,3], [1,1,3,3,3], [1,3,3,3,3]
- 以 2 开头的数组1 个):[2,2,2,2,2]

View File

@ -53,8 +53,8 @@ There are a total of 5 + 2 + 1 + 1 + 1 = 10 distinct ideal arrays.
<strong>Input:</strong> n = 5, maxValue = 3
<strong>Output:</strong> 11
<strong>Explanation:</strong> The following are the possible ideal arrays:
- Arrays starting with the value 1 (9 arrays):
- With no other distinct values (1 array): [1,1,1,1,1]
- Arrays starting with the value 1 (9 arrays):
- With no other distinct values (1 array): [1,1,1,1,1]
- With 2<sup>nd</sup> distinct value 2 (4 arrays): [1,1,1,1,2], [1,1,1,2,2], [1,1,2,2,2], [1,2,2,2,2]
- With 2<sup>nd</sup> distinct value 3 (4 arrays): [1,1,1,1,3], [1,1,1,3,3], [1,1,3,3,3], [1,3,3,3,3]
- Arrays starting with the value 2 (1 array): [2,2,2,2,2]
@ -92,8 +92,8 @@ $$
where $k$ represents the maximum value of the array, i.e., $\textit{maxValue}$.
- **Time Complexity**: $O(m \times \log^2 m)$
- **Space Complexity**: $O(m \times \log m)$
- **Time Complexity**: $O(m \times \log^2 m)$
- **Space Complexity**: $O(m \times \log m)$
<!-- tabs:start -->

View File

@ -18,6 +18,8 @@ tags:
<p>请你编写一个异步函数,它接收一个正整数参数 <code>millis</code>&nbsp;,并休眠 <code>millis</code> 毫秒。要求此函数可以解析任何值。</p>
<p><strong>请注意</strong>,实际睡眠持续时间与&nbsp;<code>millis</code> 之间的微小偏差是可以接受的。</p>
<p>&nbsp;</p>
<p><b>示例 1</b></p>

View File

@ -18,6 +18,8 @@ tags:
<p>Given&nbsp;a positive integer <code>millis</code>, write an asynchronous function that sleeps for <code>millis</code>&nbsp;milliseconds. It can resolve any value.</p>
<p><strong>Note</strong> that <em>minor</em> deviation from <code>millis</code> in the actual sleep duration is acceptable.</p>
<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

View File

@ -18,7 +18,7 @@ tags:
<!-- description:start -->
<p>给你一个整数数组&nbsp;<code>nums</code>&nbsp;,请你返回长度为 3 的 <span data-keyword="subarray-nonempty">子数组</span>,满足第一个数和第三个数的和恰好为第二个数的一半。</p>
<p>给你一个整数数组&nbsp;<code>nums</code>&nbsp;,请你返回长度为 3 的 <span data-keyword="subarray-nonempty">子数组</span> 的数量,满足第一个数和第三个数的和恰好为第二个数的一半。</p>
<p><strong>子数组</strong>&nbsp;指的是一个数组中连续 <strong>非空</strong>&nbsp;的元素序列。</p>

View File

@ -18,7 +18,7 @@ tags:
<!-- description:start -->
<p>给定一个整数数组 <code>nums</code> 和一个整数 <code>k</code>,如果元素 <code>nums[i]</code> <strong>严格</strong> 大于下标&nbsp;<code>i - k</code><code>i + k</code> 处的元素(如果这些元素存在),则该元素 <code>nums[i]</code> 被认为是 <strong></strong> 的。如果这两个下标不存在,那么 <code>nums[i]</code> 仍然被认为是 <strong></strong> 的。</p>
<p>给定一个整数数组 <code>nums</code> 和一个整数 <code>k</code>,如果元素 <code>nums[i]</code> <strong>严格</strong> 大于下标&nbsp;<code>i - k</code><code>i + k</code> 处的元素(如果这些元素存在),则该元素 <code>nums[i]</code> 被认为是 <strong></strong> 的。如果这两个下标至少一个不存在,那么 <code>nums[i]</code> 仍然被认为是 <strong></strong> 的。</p>
<p>返回数组中所有 <strong></strong> 元素的 <strong></strong></p>

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3477.Fruits%20Into%20Baskets%20II/README.md
rating: 1295
source: 第 440 场周赛 Q1
tags:
- 线段树
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3477.Fruits%20Into%20Baskets%20II/README_EN.md
rating: 1295
source: Weekly Contest 440 Q1
tags:
- Segment Tree
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3478.Choose%20K%20Elements%20With%20Maximum%20Sum/README.md
rating: 1753
source: 第 440 场周赛 Q2
tags:
- 数组
- 排序

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3478.Choose%20K%20Elements%20With%20Maximum%20Sum/README_EN.md
rating: 1753
source: Weekly Contest 440 Q2
tags:
- Array
- Sorting

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3479.Fruits%20Into%20Baskets%20III/README.md
rating: 2178
source: 第 440 场周赛 Q3
tags:
- 线段树
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3479.Fruits%20Into%20Baskets%20III/README_EN.md
rating: 2178
source: Weekly Contest 440 Q3
tags:
- Segment Tree
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3480.Maximize%20Subarrays%20After%20Removing%20One%20Conflicting%20Pair/README.md
rating: 2763
source: 第 440 场周赛 Q4
tags:
- 线段树
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3480.Maximize%20Subarrays%20After%20Removing%20One%20Conflicting%20Pair/README_EN.md
rating: 2763
source: Weekly Contest 440 Q4
tags:
- Segment Tree
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3483.Unique%203-Digit%20Even%20Numbers/README.md
rating: 1323
source: 第 152 场双周赛 Q1
tags:
- 递归
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3483.Unique%203-Digit%20Even%20Numbers/README_EN.md
rating: 1323
source: Biweekly Contest 152 Q1
tags:
- Recursion
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3484.Design%20Spreadsheet/README.md
rating: 1523
source: 第 152 场双周赛 Q2
tags:
- 设计
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3484.Design%20Spreadsheet/README_EN.md
rating: 1523
source: Biweekly Contest 152 Q2
tags:
- Design
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3485.Longest%20Common%20Prefix%20of%20K%20Strings%20After%20Removal/README.md
rating: 2289
source: 第 152 场双周赛 Q3
tags:
- 字典树
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3485.Longest%20Common%20Prefix%20of%20K%20Strings%20After%20Removal/README_EN.md
rating: 2289
source: Biweekly Contest 152 Q3
tags:
- Trie
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3486.Longest%20Special%20Path%20II/README.md
rating: 2924
source: 第 152 场双周赛 Q4
tags:
- 树
- 深度优先搜索

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3486.Longest%20Special%20Path%20II/README_EN.md
rating: 2924
source: Biweekly Contest 152 Q4
tags:
- Tree
- Depth-First Search

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3487.Maximum%20Unique%20Subarray%20Sum%20After%20Deletion/README.md
rating: 1399
source: 第 441 场周赛 Q1
tags:
- 贪心
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3487.Maximum%20Unique%20Subarray%20Sum%20After%20Deletion/README_EN.md
rating: 1399
source: Weekly Contest 441 Q1
tags:
- Greedy
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3488.Closest%20Equal%20Element%20Queries/README.md
rating: 1699
source: 第 441 场周赛 Q2
tags:
- 数组
- 哈希表

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3488.Closest%20Equal%20Element%20Queries/README_EN.md
rating: 1699
source: Weekly Contest 441 Q2
tags:
- Array
- Hash Table

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3489.Zero%20Array%20Transformation%20IV/README.md
rating: 2068
source: 第 441 场周赛 Q3
tags:
- 数组
- 动态规划

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3489.Zero%20Array%20Transformation%20IV/README_EN.md
rating: 2068
source: Weekly Contest 441 Q3
tags:
- Array
- Dynamic Programming

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3490.Count%20Beautiful%20Numbers/README.md
rating: 2502
source: 第 441 场周赛 Q4
tags:
- 动态规划
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3490.Count%20Beautiful%20Numbers/README_EN.md
rating: 2502
source: Weekly Contest 441 Q4
tags:
- Dynamic Programming
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3492.Maximum%20Containers%20on%20a%20Ship/README.md
rating: 1140
source: 第 442 场周赛 Q1
tags:
- 数学
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3492.Maximum%20Containers%20on%20a%20Ship/README_EN.md
rating: 1140
source: Weekly Contest 442 Q1
tags:
- Math
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3493.Properties%20Graph/README.md
rating: 1565
source: 第 442 场周赛 Q2
tags:
- 深度优先搜索
- 广度优先搜索

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3493.Properties%20Graph/README_EN.md
rating: 1565
source: Weekly Contest 442 Q2
tags:
- Depth-First Search
- Breadth-First Search

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3494.Find%20the%20Minimum%20Amount%20of%20Time%20to%20Brew%20Potions/README.md
rating: 2042
source: 第 442 场周赛 Q3
tags:
- 数组
- 前缀和

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3494.Find%20the%20Minimum%20Amount%20of%20Time%20to%20Brew%20Potions/README_EN.md
rating: 2042
source: Weekly Contest 442 Q3
tags:
- Array
- Prefix Sum

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3495.Minimum%20Operations%20to%20Make%20Array%20Elements%20Zero/README.md
rating: 2205
source: 第 442 场周赛 Q4
tags:
- 位运算
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3495.Minimum%20Operations%20to%20Make%20Array%20Elements%20Zero/README_EN.md
rating: 2205
source: Weekly Contest 442 Q4
tags:
- Bit Manipulation
- Array

View File

@ -102,7 +102,7 @@ activity_duration 是用户当天在平台上花费的分钟数。
<li>体验了 3 天免费试用,时长分别为 4530 和 60 分钟。</li>
<li>平均试用时长:(45 + 30 + 60) / 3 = 45.00 分钟。</li>
<li>拥有 3 天付费订阅,时长分别为 7590 和 65分钟。</li>
<li>平均花费市场(75 + 90 + 65) / 3 = 76.67 分钟。</li>
<li>平均花费时长(75 + 90 + 65) / 3 = 76.67 分钟。</li>
</ul>
</li>
<li><strong>用户 2:</strong>

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3498.Reverse%20Degree%20of%20a%20String/README.md
rating: 1201
source: 第 153 场双周赛 Q1
tags:
- 字符串
- 模拟

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3498.Reverse%20Degree%20of%20a%20String/README_EN.md
rating: 1201
source: Biweekly Contest 153 Q1
tags:
- String
- Simulation

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3499.Maximize%20Active%20Section%20with%20Trade%20I/README.md
rating: 1729
source: 第 153 场双周赛 Q2
tags:
- 字符串
- 枚举

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3400-3499/3499.Maximize%20Active%20Section%20with%20Trade%20I/README_EN.md
rating: 1729
source: Biweekly Contest 153 Q2
tags:
- String
- Enumeration

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3500.Minimum%20Cost%20to%20Divide%20Array%20Into%20Subarrays/README.md
rating: 2569
source: 第 153 场双周赛 Q3
tags:
- 数组
- 动态规划

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3500.Minimum%20Cost%20to%20Divide%20Array%20Into%20Subarrays/README_EN.md
rating: 2569
source: Biweekly Contest 153 Q3
tags:
- Array
- Dynamic Programming

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3501.Maximize%20Active%20Section%20with%20Trade%20II/README.md
rating: 2940
source: 第 153 场双周赛 Q4
tags:
- 线段树
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3501.Maximize%20Active%20Section%20with%20Trade%20II/README_EN.md
rating: 2940
source: Biweekly Contest 153 Q4
tags:
- Segment Tree
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3502.Minimum%20Cost%20to%20Reach%20Every%20Position/README.md
rating: 1243
source: 第 443 场周赛 Q1
tags:
- 数组
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3502.Minimum%20Cost%20to%20Reach%20Every%20Position/README_EN.md
rating: 1243
source: Weekly Contest 443 Q1
tags:
- Array
---

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3503.Longest%20Palindrome%20After%20Substring%20Concatenation%20I/README.md
rating: 1548
source: 第 443 场周赛 Q2
tags:
- 双指针
- 字符串

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3503.Longest%20Palindrome%20After%20Substring%20Concatenation%20I/README_EN.md
rating: 1548
source: Weekly Contest 443 Q2
tags:
- Two Pointers
- String

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README.md
rating: 2397
source: 第 443 场周赛 Q3
tags:
- 双指针
- 字符串

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3504.Longest%20Palindrome%20After%20Substring%20Concatenation%20II/README_EN.md
rating: 2397
source: Weekly Contest 443 Q3
tags:
- Two Pointers
- String

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README.md
rating: 2538
source: 第 443 场周赛 Q4
tags:
- 数组
- 哈希表

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3505.Minimum%20Operations%20to%20Make%20Elements%20Within%20K%20Subarrays%20Equal/README_EN.md
rating: 2538
source: Weekly Contest 443 Q4
tags:
- Array
- Hash Table

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README.md
rating: 1348
source: 第 444 场周赛 Q1
tags:
- 数组
- 哈希表

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3507.Minimum%20Pair%20Removal%20to%20Sort%20Array%20I/README_EN.md
rating: 1348
source: Weekly Contest 444 Q1
tags:
- Array
- Hash Table

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3508.Implement%20Router/README.md
rating: 1851
source: 第 444 场周赛 Q2
tags:
- 设计
- 队列

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3508.Implement%20Router/README_EN.md
rating: 1851
source: Weekly Contest 444 Q2
tags:
- Design
- Queue

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README.md
rating: 2702
source: 第 444 场周赛 Q3
tags:
- 数组
- 哈希表

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3509.Maximum%20Product%20of%20Subsequences%20With%20an%20Alternating%20Sum%20Equal%20to%20K/README_EN.md
rating: 2702
source: Weekly Contest 444 Q3
tags:
- Array
- Hash Table

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 困难
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3510.Minimum%20Pair%20Removal%20to%20Sort%20Array%20II/README.md
rating: 2608
source: 第 444 场周赛 Q4
tags:
- 数组
- 哈希表

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Hard
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3510.Minimum%20Pair%20Removal%20to%20Sort%20Array%20II/README_EN.md
rating: 2608
source: Weekly Contest 444 Q4
tags:
- Array
- Hash Table

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 简单
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README.md
rating: 1228
source: 第 154 场双周赛 Q1
tags:
- 数组
- 数学

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Easy
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3512.Minimum%20Operations%20to%20Make%20Array%20Sum%20Divisible%20by%20K/README_EN.md
rating: 1228
source: Biweekly Contest 154 Q1
tags:
- Array
- Math

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README.md
rating: 1663
source: 第 154 场双周赛 Q2
tags:
- 位运算
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3513.Number%20of%20Unique%20XOR%20Triplets%20I/README_EN.md
rating: 1663
source: Biweekly Contest 154 Q2
tags:
- Bit Manipulation
- Array

View File

@ -2,6 +2,8 @@
comments: true
difficulty: 中等
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README.md
rating: 1883
source: 第 154 场双周赛 Q3
tags:
- 位运算
- 数组

View File

@ -2,6 +2,8 @@
comments: true
difficulty: Medium
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3514.Number%20of%20Unique%20XOR%20Triplets%20II/README_EN.md
rating: 1883
source: Biweekly Contest 154 Q3
tags:
- Bit Manipulation
- Array
@ -64,7 +66,7 @@ tags:
<ul>
<li><code>1 &lt;= nums.length &lt;= 1500</code></li>
<li><code><font face="monospace">1 &lt;= nums[i] &lt;= 1500</font></code></li>
<li><code>1 &lt;= nums[i] &lt;= 1500</code></li>
</ul>
<!-- description:end -->

Some files were not shown because too many files have changed in this diff Show More