Skip to content

Commit 5cfafe4

Browse files
committed
feat: add new lc problems and update summary
1 parent fa89780 commit 5cfafe4

File tree

17 files changed

+436
-124
lines changed

17 files changed

+436
-124
lines changed

solution/0100-0199/0192.Word Frequency/README.md

+2-16
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,11 @@ day 1
4646

4747
<!-- tabs:start -->
4848

49-
### **Python3**
49+
### **Bash**
5050

5151
<!-- 这里可写当前语言的特殊实现逻辑 -->
5252

53-
```python
54-
55-
```
56-
57-
### **Java**
58-
59-
<!-- 这里可写当前语言的特殊实现逻辑 -->
60-
61-
```java
62-
63-
```
64-
65-
### **...**
66-
67-
```
53+
```sh
6854

6955
```
7056

solution/0100-0199/0192.Word Frequency/README_EN.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -71,21 +71,9 @@ day 1
7171

7272
<!-- tabs:start -->
7373

74-
### **Python3**
74+
### **Bash**
7575

76-
```python
77-
78-
```
79-
80-
### **Java**
81-
82-
```java
83-
84-
```
85-
86-
### **...**
87-
88-
```
76+
```sh
8977

9078
```
9179

solution/0100-0199/0193.Valid Phone Numbers/README.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,12 @@
3838

3939
<!-- tabs:start -->
4040

41-
### **Python3**
41+
### **Bash**
4242

4343
<!-- 这里可写当前语言的特殊实现逻辑 -->
4444

45-
```python
45+
```sh
4646

4747
```
4848

49-
### **Java**
50-
51-
<!-- 这里可写当前语言的特殊实现逻辑 -->
52-
53-
```java
54-
55-
```
56-
57-
### **...**
58-
59-
```
60-
61-
```
62-
63-
<!-- tabs:end -->
49+
<!-- tabs:end -->

solution/0100-0199/0193.Valid Phone Numbers/README_EN.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,9 @@
3232

3333
<!-- tabs:start -->
3434

35-
### **Python3**
35+
### **Bash**
3636

37-
```python
38-
39-
```
40-
41-
### **Java**
42-
43-
```java
44-
45-
```
46-
47-
### **...**
48-
49-
```
37+
```sh
5038

5139
```
5240

solution/0100-0199/0194.Transpose File/README.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,12 @@ age 21 30
3636

3737
<!-- tabs:start -->
3838

39-
### **Python3**
39+
### **Bash**
4040

4141
<!-- 这里可写当前语言的特殊实现逻辑 -->
4242

43-
```python
43+
```sh
4444

4545
```
4646

47-
### **Java**
48-
49-
<!-- 这里可写当前语言的特殊实现逻辑 -->
50-
51-
```java
52-
53-
```
54-
55-
### **...**
56-
57-
```
58-
59-
```
60-
61-
<!-- tabs:end -->
47+
<!-- tabs:end -->

solution/0100-0199/0194.Transpose File/README_EN.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,9 @@ age 21 30
3030

3131
<!-- tabs:start -->
3232

33-
### **Python3**
33+
### **Bash**
3434

35-
```python
36-
37-
```
38-
39-
### **Java**
40-
41-
```java
42-
43-
```
44-
45-
### **...**
46-
47-
```
35+
```sh
4836

4937
```
5038

solution/0100-0199/0195.Tenth Line/README.md

+3-17
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,12 @@ Line 10
4040

4141
<!-- tabs:start -->
4242

43-
### **Python3**
43+
### **Bash**
4444

4545
<!-- 这里可写当前语言的特殊实现逻辑 -->
4646

47-
```python
47+
```sh
4848

4949
```
5050

51-
### **Java**
52-
53-
<!-- 这里可写当前语言的特殊实现逻辑 -->
54-
55-
```java
56-
57-
```
58-
59-
### **...**
60-
61-
```
62-
63-
```
64-
65-
<!-- tabs:end -->
51+
<!-- tabs:end -->

solution/0100-0199/0195.Tenth Line/README_EN.md

+2-14
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,9 @@ Line 10
6666

6767
<!-- tabs:start -->
6868

69-
### **Python3**
69+
### **Bash**
7070

71-
```python
72-
73-
```
74-
75-
### **Java**
76-
77-
```java
78-
79-
```
80-
81-
### **...**
82-
83-
```
71+
```sh
8472

8573
```
8674

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# [1890. The Latest Login in 2020](https://leetcode-cn.com/problems/the-latest-login-in-2020)
2+
3+
[English Version](/solution/1800-1899/1890.The%20Latest%20Login%20in%202020/README_EN.md)
4+
5+
## 题目描述
6+
7+
<!-- 这里写题目描述 -->
8+
9+
<p>Table: <code>Logins</code></p>
10+
11+
<pre>
12+
13+
+----------------+----------+
14+
15+
| Column Name | Type |
16+
17+
+----------------+----------+
18+
19+
| user_id | int |
20+
21+
| time_stamp | datetime |
22+
23+
+----------------+----------+
24+
25+
(user_id, time_stamp) is the primary key for this table.
26+
27+
Each row contains information about the login time for the user with ID user_id.
28+
29+
</pre>
30+
31+
<p>&nbsp;</p>
32+
33+
<p>Write an SQL query to report the <strong>latest</strong> login for all users in the year <code>2020</code>. Do <strong>not</strong> include the users who did not login in <code>2020</code>.</p>
34+
35+
<p>Return the result table <strong>in any order</strong>.</p>
36+
37+
<p>The query result format is in the following example:</p>
38+
39+
<p>&nbsp;</p>
40+
41+
<pre>
42+
43+
Logins table:
44+
45+
+---------+---------------------+
46+
47+
| user_id | time_stamp |
48+
49+
+---------+---------------------+
50+
51+
| 6 | 2020-06-30 15:06:07 |
52+
53+
| 6 | 2021-04-21 14:06:06 |
54+
55+
| 6 | 2019-03-07 00:18:15 |
56+
57+
| 8 | 2020-02-01 05:10:53 |
58+
59+
| 8 | 2020-12-30 00:46:50 |
60+
61+
| 2 | 2020-01-16 02:49:50 |
62+
63+
| 2 | 2019-08-25 07:59:08 |
64+
65+
| 14 | 2019-07-14 09:00:00 |
66+
67+
| 14 | 2021-01-06 11:59:59 |
68+
69+
+---------+---------------------+
70+
71+
72+
73+
Result table:
74+
75+
+---------+---------------------+
76+
77+
| user_id | last_stamp |
78+
79+
+---------+---------------------+
80+
81+
| 6 | 2020-06-30 15:06:07 |
82+
83+
| 8 | 2020-12-30 00:46:50 |
84+
85+
| 2 | 2020-01-16 02:49:50 |
86+
87+
+---------+---------------------+
88+
89+
90+
91+
User 6 logged into their account 3 times but only once in 2020, so we include this login in the result table.
92+
93+
User 8 logged into their account 2 times in 2020, once in February and once in December. We include only the latest one (December) in the result table.
94+
95+
User 2 logged into their account 2 times but only once in 2020, so we include this login in the result table.
96+
97+
User 14 did not login in 2020, so we do not include them in the result table.
98+
99+
</pre>
100+
101+
## 解法
102+
103+
<!-- 这里可写通用的实现逻辑 -->
104+
105+
<!-- tabs:start -->
106+
107+
### **SQL**
108+
109+
<!-- 这里可写当前语言的特殊实现逻辑 -->
110+
111+
```sql
112+
113+
```
114+
115+
<!-- tabs:end -->

0 commit comments

Comments
 (0)