Skip to content

Commit 25b635a

Browse files
committed
feat: update lc problems
1 parent 3257445 commit 25b635a

File tree

120 files changed

+5087
-12653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+5087
-12653
lines changed

solution/0400-0499/0427.Construct Quad Tree/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class Node {
5050

5151
<p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/0400-0499/0427.Construct%20Quad%20Tree/images/new_top.png" style="height: 181px; width: 777px;" /></p>
5252

53-
<p>如果你想了解更多关于四叉树的内容,可以参考 <a href="https://en.wikipedia.org/wiki/Quadtree">wiki</a> 。</p>
53+
<p>如果你想了解更多关于四叉树的内容,可以参考 <a href="https://baike.baidu.com/item/%E5%9B%9B%E5%8F%89%E6%A0%91">百科</a> 。</p>
5454

5555
<p><strong>四叉树格式:</strong></p>
5656

solution/0800-0899/0853.Car Fleet/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tags:
2121

2222
<p>There are <code>n</code> cars at given miles away from the starting mile 0, traveling to reach the mile <code>target</code>.</p>
2323

24-
<p>You are given two integer array <code>position</code> and <code>speed</code>, both of length <code>n</code>, where <code>position[i]</code> is the starting mile of the <code>i<sup>th</sup></code> car and <code>speed[i]</code> is the speed of the <code>i<sup>th</sup></code> car in miles per hour.</p>
24+
<p>You are given two integer arrays&nbsp;<code>position</code> and <code>speed</code>, both of length <code>n</code>, where <code>position[i]</code> is the starting mile of the <code>i<sup>th</sup></code> car and <code>speed[i]</code> is the speed of the <code>i<sup>th</sup></code> car in miles per hour.</p>
2525

2626
<p>A car cannot pass another car, but it can catch up and then travel next to it at the speed of the slower car.</p>
2727

solution/1500-1599/1516.Move Sub-Tree of N-Ary Tree/README_EN.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ Notice that node 4 is the last child of node 1.</pre>
6868
<strong>Explanation:</strong> This example follows case 3 because node p is not in the sub-tree of node q and vice-versa. We can move node 3 with its sub-tree and make it as node 8&#39;s child.
6969
</pre>
7070

71+
<p><strong class="example">Example 4:</strong></p>
72+
<img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/solution/1500-1599/1516.Move%20Sub-Tree%20of%20N-Ary%20Tree/images/untitled-diagramdrawio.png" style="width: 500px; height: 175px;" />
73+
<pre>
74+
<strong>Input:</strong> root = [1,null,2,3,null,4], p = 1, q = 4
75+
<strong>Output:</strong> [4,null,1,null,2,3]
76+
<strong>Explanation:</strong> This example follows case 1 because node q is in the sub-tree of node p. Disconnect 4 with its parent and move node 1 with its sub-tree and make it as node 4&#39;s child.
77+
</pre>
78+
7179
<p>&nbsp;</p>
7280
<p><strong>Constraints:</strong></p>
7381

solution/1900-1999/1962.Remove Stones to Minimize the Total/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ tags:
2323
<p>You are given a <strong>0-indexed</strong> integer array <code>piles</code>, where <code>piles[i]</code> represents the number of stones in the <code>i<sup>th</sup></code> pile, and an integer <code>k</code>. You should apply the following operation <strong>exactly</strong> <code>k</code> times:</p>
2424

2525
<ul>
26-
<li>Choose any <code>piles[i]</code> and <strong>remove</strong> <code>ceil(piles[i] / 2)</code> stones from it.</li>
26+
<li>Choose any <code>piles[i]</code> and <strong>remove</strong> <code>floor(piles[i] / 2)</code> stones from it.</li>
2727
</ul>
2828

2929
<p><strong>Notice</strong> that you can apply the operation on the <strong>same</strong> pile more than once.</p>
3030

3131
<p>Return <em>the <strong>minimum</strong> possible total number of stones remaining after applying the </em><code>k</code><em> operations</em>.</p>
3232

33-
<p><code>ceil(x)</code> is the <b>smallest</b> integer that is <strong>greater</strong> than or <strong>equal</strong> to <code>x</code> (i.e., rounds <code>x</code> up).</p>
33+
<p><code>floor(x)</code> is the <strong>largest</strong>&nbsp;integer that is <strong>smaller</strong> than or <strong>equal</strong> to <code>x</code> (i.e., rounds <code>x</code>&nbsp;down).</p>
3434

3535
<p>&nbsp;</p>
3636
<p><strong class="example">Example 1:</strong></p>

solution/1900-1999/1994.The Number of Good Subsets/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ source: 第 60 场双周赛 Q4
77
tags:
88
- 位运算
99
- 数组
10+
- 哈希表
1011
- 数学
1112
- 动态规划
1213
- 状态压缩
14+
- 计数
15+
- 数论
1316
---
1417

1518
<!-- problem:start -->

solution/1900-1999/1994.The Number of Good Subsets/README_EN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ source: Biweekly Contest 60 Q4
77
tags:
88
- Bit Manipulation
99
- Array
10+
- Hash Table
1011
- Math
1112
- Dynamic Programming
1213
- Bitmask
14+
- Counting
15+
- Number Theory
1316
---
1417

1518
<!-- problem:start -->

solution/3000-3099/3060.User Activities within Time Bounds/README_EN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ session_type is an ENUM (category) type of (Viewer, Streamer).
3333
This table contains user id, session start, session end, session id and session type.
3434
</pre>
3535

36-
<p>Write a solution to find the the <strong>users</strong> who have had <strong>at least one</strong> <strong>consecutive session</strong> of the <strong>same</strong> type (either &#39;<strong>Viewer</strong>&#39; or &#39;<strong>Streamer</strong>&#39;) with a <strong>maximum</strong> gap of <code>12</code> hours <strong>between</strong> sessions.</p>
36+
<p>Write a solution to find the the <strong>users</strong> who have had <strong>at least two</strong><strong>&nbsp;session</strong> of the <strong>same</strong> type (either &#39;<strong>Viewer</strong>&#39; or &#39;<strong>Streamer</strong>&#39;) with a <strong>maximum</strong> gap of <code>12</code> hours <strong>between</strong> sessions.</p>
3737

3838
<p>Return <em>the result table ordered by </em><code>user_id</code><em> in <b>ascending</b> order.</em></p>
3939

@@ -68,7 +68,7 @@ Sessions table:
6868
| 103 |
6969
+---------+
7070
<strong>Explanation:</strong>
71-
- User ID 101 will not be included in the final output as they do not have any consecutive sessions of the same session type.
71+
- User ID 101 will not be included in the final output as they do not have any two sessions of the same session type.
7272
- User ID 102 will be included in the final output as they had two viewer sessions with session IDs 3 and 4, respectively, and the time gap between them was less than 12 hours.
7373
- User ID 103 participated in two viewer sessions with a gap of less than 12 hours between them, identified by session IDs 10 and 11. Therefore, user 103 will be included in the final output.
7474
Output table is ordered by user_id in increasing order.

solution/3100-3199/3156.Employee Task Duration and Concurrent Tasks/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ tags:
3131
这张表的每一行包含任务标识,员工标识和每个任务的开始和结束时间。
3232
</pre>
3333

34-
<p>编写一个解决方案来查找 <strong>每个</strong> 员工的任务 <strong>总持续时间</strong> 以及员工在任何时间点处理的 <strong>最大并发任务数</strong>。总时长应该 <strong>舍入</strong> 到最近的 <strong>整小时</strong>。</p>
34+
<p>编写一个解决方案来查找 <strong>每个</strong> 员工的任务 <strong>总持续时间</strong> 以及员工在任何时间点处理的 <strong>最大并发任务数</strong>。总时长应该 <strong>向下取整</strong>&nbsp;到最近的 <strong>整小时</strong>。</p>
3535

3636
<p>返回结果表以&nbsp;<code>employee_id</code><strong> <em>升序</em></strong><em>&nbsp;排序。</em></p>
3737

solution/3400-3499/3415.Find Products with Three Consecutive Digits/README_EN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ product_id is the unique key for this table.
2929
Each row of this table contains the ID and name of a product.
3030
</pre>
3131

32-
<p>Write a solution to find all <strong>products</strong> whose names contain a <strong>sequence of exactly three digits in a row</strong>.&nbsp;</p>
32+
<p>Write a solution to find all <strong>products</strong> whose names contain a <strong>sequence of exactly three consecutive digits in a row</strong>.&nbsp;</p>
3333

3434
<p>Return <em>the result table ordered by</em> <code>product_id</code> <em>in <strong>ascending</strong> order.</em></p>
3535

3636
<p>The result format is in the following example.</p>
3737

38+
<p><strong>Note</strong> that the name may contain multiple such sequences, but each should have length three.</p>
39+
3840
<p>&nbsp;</p>
3941
<p><strong class="example">Example:</strong></p>
4042

solution/3500-3599/3572.Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
comments: true
33
difficulty: 中等
44
edit_url: https://github.com/doocs/leetcode/edit/main/solution/3500-3599/3572.Maximize%20Y%E2%80%91Sum%20by%20Picking%20a%20Triplet%20of%20Distinct%20X%E2%80%91Values/README.md
5+
rating: 1319
6+
source: 第 158 场双周赛 Q1
57
tags:
68
- 贪心
79
- 数组

0 commit comments

Comments
 (0)