Skip to content

Commit 7794df0

Browse files
committed
clear readme
1 parent 2164742 commit 7794df0

File tree

3 files changed

+6
-134
lines changed

3 files changed

+6
-134
lines changed

README.md

-21
Original file line numberDiff line numberDiff line change
@@ -1,21 +0,0 @@
1-
# Leetcode
2-
## Contest
3-
| # | Date | Rank | Solved |
4-
|---|---|---|---|
5-
## Problem
6-
| # | Date | C++ | Python | Tutorial |
7-
|---|---|---|---|---|
8-
| [word-break](https://leetcode.com/problems/word-break/) | 22/08/2023 02:01:56 || [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/word-break/solution.py) ||
9-
| [car-fleet](https://leetcode.com/problems/car-fleet/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/car-fleet/solution.h) |||
10-
| [permutations](https://leetcode.com/problems/permutations/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/permutations/solution.h) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/permutations/solution.py) ||
11-
| [card-flipping-game](https://leetcode.com/problems/card-flipping-game/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/card-flipping-game/solution.h) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/card-flipping-game/solution.py) ||
12-
| [unique-paths-iii](https://leetcode.com/problems/unique-paths-iii/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/unique-paths-iii/solution.h) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/unique-paths-iii/solution.py) ||
13-
| [count-zero-request-servers](https://leetcode.com/problems/count-zero-request-servers/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/count-zero-request-servers/solution.h) |||
14-
| [utils](https://leetcode.com/problems/utils/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/utils/solution.h) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/utils/solution.py) ||
15-
| [remove-comments](https://leetcode.com/problems/remove-comments/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/remove-comments/solution.h) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/remove-comments/solution.py) ||
16-
| [find-the-longest-semi-repetitive-substring](https://leetcode.com/problems/find-the-longest-semi-repetitive-substring/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/find-the-longest-semi-repetitive-substring/solution.h) |||
17-
| [count-pairs-of-nodes](https://leetcode.com/problems/count-pairs-of-nodes/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/count-pairs-of-nodes/solution.h) |||
18-
| [maximize-distance-to-closest-person](https://leetcode.com/problems/maximize-distance-to-closest-person/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/maximize-distance-to-closest-person/solution.h) |||
19-
| [minimum-degree-of-a-connected-trio-in-a-graph](https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/minimum-degree-of-a-connected-trio-in-a-graph/solution.h) || [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/minimum-degree-of-a-connected-trio-in-a-graph/README.md) |
20-
| [last-moment-before-all-ants-fall-out-of-a-plank](https://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/last-moment-before-all-ants-fall-out-of-a-plank/solution.h) |||
21-
| [car-fleet-ii](https://leetcode.com/problems/car-fleet-ii/) | 22/08/2023 02:01:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/car-fleet-ii/solution.h) |||

data.json

-112
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,5 @@
11
{
22
"contest": {},
33
"problem": {
4-
"word-break": {
5-
"name": "word-break",
6-
"url": "https://leetcode.com/problems/word-break/",
7-
"date": "22/08/2023 02:01:56",
8-
"cpp": "",
9-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/word-break/solution.py",
10-
"tutorial": ""
11-
},
12-
"car-fleet": {
13-
"name": "car-fleet",
14-
"url": "https://leetcode.com/problems/car-fleet/",
15-
"date": "22/08/2023 02:01:56",
16-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/car-fleet/solution.h",
17-
"python": "",
18-
"tutorial": ""
19-
},
20-
"permutations": {
21-
"name": "permutations",
22-
"url": "https://leetcode.com/problems/permutations/",
23-
"date": "22/08/2023 02:01:56",
24-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/permutations/solution.h",
25-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/permutations/solution.py",
26-
"tutorial": ""
27-
},
28-
"card-flipping-game": {
29-
"name": "card-flipping-game",
30-
"url": "https://leetcode.com/problems/card-flipping-game/",
31-
"date": "22/08/2023 02:01:56",
32-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/card-flipping-game/solution.h",
33-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/card-flipping-game/solution.py",
34-
"tutorial": ""
35-
},
36-
"unique-paths-iii": {
37-
"name": "unique-paths-iii",
38-
"url": "https://leetcode.com/problems/unique-paths-iii/",
39-
"date": "22/08/2023 02:01:56",
40-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/unique-paths-iii/solution.h",
41-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/unique-paths-iii/solution.py",
42-
"tutorial": ""
43-
},
44-
"count-zero-request-servers": {
45-
"name": "count-zero-request-servers",
46-
"url": "https://leetcode.com/problems/count-zero-request-servers/",
47-
"date": "22/08/2023 02:01:56",
48-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/count-zero-request-servers/solution.h",
49-
"python": "",
50-
"tutorial": ""
51-
},
52-
"utils": {
53-
"name": "utils",
54-
"url": "https://leetcode.com/problems/utils/",
55-
"date": "22/08/2023 02:01:56",
56-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/utils/solution.h",
57-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/utils/solution.py",
58-
"tutorial": ""
59-
},
60-
"remove-comments": {
61-
"name": "remove-comments",
62-
"url": "https://leetcode.com/problems/remove-comments/",
63-
"date": "22/08/2023 02:01:56",
64-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/remove-comments/solution.h",
65-
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/remove-comments/solution.py",
66-
"tutorial": ""
67-
},
68-
"find-the-longest-semi-repetitive-substring": {
69-
"name": "find-the-longest-semi-repetitive-substring",
70-
"url": "https://leetcode.com/problems/find-the-longest-semi-repetitive-substring/",
71-
"date": "22/08/2023 02:01:56",
72-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/find-the-longest-semi-repetitive-substring/solution.h",
73-
"python": "",
74-
"tutorial": ""
75-
},
76-
"count-pairs-of-nodes": {
77-
"name": "count-pairs-of-nodes",
78-
"url": "https://leetcode.com/problems/count-pairs-of-nodes/",
79-
"date": "22/08/2023 02:01:56",
80-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/count-pairs-of-nodes/solution.h",
81-
"python": "",
82-
"tutorial": ""
83-
},
84-
"maximize-distance-to-closest-person": {
85-
"name": "maximize-distance-to-closest-person",
86-
"url": "https://leetcode.com/problems/maximize-distance-to-closest-person/",
87-
"date": "22/08/2023 02:01:56",
88-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/maximize-distance-to-closest-person/solution.h",
89-
"python": "",
90-
"tutorial": ""
91-
},
92-
"minimum-degree-of-a-connected-trio-in-a-graph": {
93-
"name": "minimum-degree-of-a-connected-trio-in-a-graph",
94-
"url": "https://leetcode.com/problems/minimum-degree-of-a-connected-trio-in-a-graph/",
95-
"date": "22/08/2023 02:01:56",
96-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/minimum-degree-of-a-connected-trio-in-a-graph/solution.h",
97-
"python": "",
98-
"tutorial": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/minimum-degree-of-a-connected-trio-in-a-graph/README.md"
99-
},
100-
"last-moment-before-all-ants-fall-out-of-a-plank": {
101-
"name": "last-moment-before-all-ants-fall-out-of-a-plank",
102-
"url": "https://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank/",
103-
"date": "22/08/2023 02:01:56",
104-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/last-moment-before-all-ants-fall-out-of-a-plank/solution.h",
105-
"python": "",
106-
"tutorial": ""
107-
},
108-
"car-fleet-ii": {
109-
"name": "car-fleet-ii",
110-
"url": "https://leetcode.com/problems/car-fleet-ii/",
111-
"date": "22/08/2023 02:01:56",
112-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/car-fleet-ii/solution.h",
113-
"python": "",
114-
"tutorial": ""
115-
}
1164
}
1175
}

script.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import json
55
import os
66
from datetime import datetime
7+
import pytz
78
# read data.json
89
current_dir = os.path.dirname(os.path.realpath(__file__))
910
with open(f'{current_dir}/data.json', "r") as f:
@@ -21,14 +22,18 @@
2122
problem_python.add(problem)
2223
problems.add(problem)
2324

25+
target_timezone = pytz.timezone('Asia/Shanghai')
26+
2427
for problem in problems:
2528
cpp_url = f"https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/{problem}/solution.h" if problem in problem_cpp else ""
2629
python_url = f"https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/{problem}/solution.py" if problem in problem_python else ""
2730
tutorial_url = f"https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/{problem}/README.md" if os.path.exists(f'{current_dir}/problems-cpp/{problem}/README.md') else ""
31+
# utc+8
32+
now = datetime.now(tz=target_timezone).strftime("%d/%m/%Y %H:%M:%S")
2833
problem_data = {
2934
"name": problem,
3035
"url": f"https://leetcode.com/problems/{problem}/",
31-
"date": datetime.now().strftime("%d/%m/%Y %H:%M:%S") if problem not in datas["problem"] else datas["problem"][problem]["date"],
36+
"date": now if problem not in datas["problem"] else datas["problem"][problem]["date"],
3237
"cpp": cpp_url,
3338
"python": python_url,
3439
"tutorial": tutorial_url,

0 commit comments

Comments
 (0)