Skip to content

Commit aae0d64

Browse files
committedDec 25, 2022
feat: update lc problems
1 parent 863a34a commit aae0d64

File tree

64 files changed

+3324
-665
lines changed

Some content is hidden

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

64 files changed

+3324
-665
lines changed
 

‎solution/0200-0299/0258.Add Digits/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
由于&nbsp;<code>2</code> 是一位数,所以返回 2。
2222
</pre>
2323

24-
<p><strong>示例 1:</strong></p>
24+
<p><strong>示例 2:</strong></p>
2525

2626
<pre>
2727
<strong>输入:</strong> num =<strong> </strong>0

‎solution/2100-2199/2153.The Number of Passengers in Each Bus II/README.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# [2153. The Number of Passengers in Each Bus II](https://leetcode.cn/problems/the-number-of-passengers-in-each-bus-ii)
1+
# [2153. 每辆车的乘客人数 II](https://leetcode.cn/problems/the-number-of-passengers-in-each-bus-ii)
22

33
[English Version](/solution/2100-2199/2153.The%20Number%20of%20Passengers%20in%20Each%20Bus%20II/README_EN.md)
44

55
## 题目描述
66

77
<!-- 这里写题目描述 -->
88

9-
<p>Table: <code>Buses</code></p>
9+
<p>: <code>Buses</code></p>
1010

1111
<pre>
1212
+--------------+------+
@@ -16,14 +16,14 @@
1616
| arrival_time | int |
1717
| capacity | int |
1818
+--------------+------+
19-
bus_id is the primary key column for this table.
20-
Each row of this table contains information about the arrival time of a bus at the LeetCode station and its capacity (the number of empty seats it has).
21-
No two buses will arrive at the same time and all bus capacities will be positive integers.
19+
bus_id 是该表的主键。
20+
该表的每一行都包含关于公交车到达 LeetCode 站点的时间和它的容量 (空座位的数量) 的信息。
21+
不会出现两辆公交车同时到达,所有公交车的容量都是正整数。
2222
</pre>
2323

2424
<p>&nbsp;</p>
2525

26-
<p>Table: <code>Passengers</code></p>
26+
<p>: <code>Passengers</code></p>
2727

2828
<pre>
2929
+--------------+------+
@@ -32,34 +32,35 @@ No two buses will arrive at the same time and all bus capacities will be positiv
3232
| passenger_id | int |
3333
| arrival_time | int |
3434
+--------------+------+
35-
passenger_id is the primary key column for this table.
36-
Each row of this table contains information about the arrival time of a passenger at the LeetCode station.
35+
passenger_id 是该表的主键。
36+
该表的每一行都包含乘客到达 LeetCode 站的时间信息。
3737
</pre>
3838

3939
<p>&nbsp;</p>
4040

41-
<p>Buses and passengers arrive at the LeetCode station. If a bus arrives at the station at a time <code>t<sub>bus</sub></code> and a passenger arrived at a time <code>t<sub>passenger</sub></code> where <code>t<sub>passenger</sub> &lt;= t<sub>bus</sub></code> and the passenger did not catch any bus, the passenger will use that bus. In addition, each bus has a capacity. If at the moment the bus arrives at the station there are more passengers waiting than its capacity <code>capacity</code>, only <code>capacity</code> passengers will use the bus.</p>
41+
<p>公交车和乘客到达 LeetCode 站。如果一辆公交车在 <code>t<sub>bus</sub></code> 时间点到达车站,乘客在 <code>t<sub>passenger</sub></code> 到达车站,其中&nbsp;<code>t<sub>passenger</sub> &lt;= t<sub>bus</sub></code>,而该乘客没有赶上任何公交车,则该乘客将搭乘该公交车。此外,每辆公交车都有一个容量。如果在公交车到站的那一刻,等待的乘客超过了它的载客量 <code>capacity</code>,只有&nbsp;<code>capacity</code> 个乘客才会搭乘该公交车。</p>
4242

43-
<p>Write an SQL query to report the number of users that used each bus.</p>
43+
<p>编写一个 SQL 来查询使用每条总线的用户数量。</p>
4444

45-
<p>Return the result table ordered by <code>bus_id</code> in <strong>ascending order</strong>.</p>
45+
<p>返回按 <code>bus_id</code> <strong>升序排序&nbsp;</strong>的结果表。</p>
4646

47-
<p>The query result format is in the following example.</p>
47+
<p>查询结果格式如下所示。</p>
4848

4949
<p>&nbsp;</p>
50-
<p><strong class="example">Example 1:</strong></p>
50+
51+
<p><strong>示例 1:</strong></p>
5152

5253
<pre>
53-
<strong>Input:</strong>
54-
Buses table:
54+
<strong>输入:</strong>
55+
Buses :
5556
+--------+--------------+----------+
5657
| bus_id | arrival_time | capacity |
5758
+--------+--------------+----------+
5859
| 1 | 2 | 1 |
5960
| 2 | 4 | 10 |
6061
| 3 | 7 | 2 |
6162
+--------+--------------+----------+
62-
Passengers table:
63+
Passengers :
6364
+--------------+--------------+
6465
| passenger_id | arrival_time |
6566
+--------------+--------------+
@@ -69,26 +70,25 @@ Passengers table:
6970
| 14 | 6 |
7071
| 15 | 7 |
7172
+--------------+--------------+
72-
<strong>Output:</strong>
73+
<strong>输出:</strong>
7374
+--------+----------------+
7475
| bus_id | passengers_cnt |
7576
+--------+----------------+
7677
| 1 | 1 |
7778
| 2 | 1 |
7879
| 3 | 2 |
7980
+--------+----------------+
80-
<strong>Explanation:</strong>
81-
- Passenger 11 arrives at time 1.
82-
- Passenger 12 arrives at time 1.
83-
- Bus 1 arrives at time 2 and collects passenger 11 as it has one empty seat.
81+
<strong>解释:</strong>
82+
- 11 号乘客在时间 1 到达。
83+
- 12 号乘客在时间 1 到达。
84+
- 1 号公交车到达时间为 2,因为有一个空座位,所以搭载了 11 号乘客。
8485

85-
- Bus 2 arrives at time 4 and collects passenger 12 as it has ten empty seats.
86+
- 2 号公交车在时间 4 到达,搭载了12 号乘客,因为它有 10 个空座位。
8687

87-
- Passenger 12 arrives at time 5.
88-
- Passenger 13 arrives at time 6.
89-
- Passenger 14 arrives at time 7.
90-
- Bus 3 arrives at time 7 and collects passengers 12 and 13 as it has two empty seats.
91-
</pre>
88+
- 13 号乘客在时间 5 到达。
89+
- 14 号乘客在时间 6 到达。
90+
- 15 号乘客在时间 7 到达。
91+
- 3 号公交车在时间 7 到达,车上有两个空座位,搭载了 12 号和 13 号乘客。</pre>
9292

9393
## 解法
9494

0 commit comments

Comments
 (0)