Skip to content

Commit 425c36d

Browse files
committed
fix script sort bug
1 parent 35466f9 commit 425c36d

File tree

3 files changed

+48
-30
lines changed

3 files changed

+48
-30
lines changed

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
## Problem
77
| # | Date | C++ | Python | Tutorial |
88
|---|---|---|---|---|
9+
| [poor-pigs](https://leetcode.com/problems/poor-pigs/) | 02/09/2023 11:34:16 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/poor-pigs/solution.h) |||
10+
| [distinct-subsequences](https://leetcode.com/problems/distinct-subsequences/) | 02/09/2023 11:34:16 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/distinct-subsequences/solution.h) |||
11+
| [freedom-trail](https://leetcode.com/problems/freedom-trail/) | 02/09/2023 11:28:16 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/freedom-trail/solution.h) |||
12+
| [ipo](https://leetcode.com/problems/ipo/) | 02/09/2023 10:54:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/ipo/solution.h) |||
13+
| [reverse-pairs](https://leetcode.com/problems/reverse-pairs/) | 02/09/2023 10:47:27 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/reverse-pairs/solution.h) |||
914
| [arithmetic-slices-ii-subsequence](https://leetcode.com/problems/arithmetic-slices-ii-subsequence/) | 31/08/2023 22:09:09 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/arithmetic-slices-ii-subsequence/solution.h) |||
1015
| [all-oone-data-structure](https://leetcode.com/problems/all-oone-data-structure/) | 31/08/2023 21:36:45 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/all-oone-data-structure/solution.h) |||
1116
| [strong-password-checker](https://leetcode.com/problems/strong-password-checker/) | 31/08/2023 16:07:47 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/strong-password-checker/solution.h) |||
@@ -73,11 +78,8 @@
7378
| [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 10:14:33 | [](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) |
7479
| [word-break](https://leetcode.com/problems/word-break/) | 22/08/2023 10:14:33 || [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/word-break/solution.py) ||
7580
| [find-the-longest-semi-repetitive-substring](https://leetcode.com/problems/find-the-longest-semi-repetitive-substring/) | 22/08/2023 10:14:33 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/find-the-longest-semi-repetitive-substring/solution.h) |||
76-
| [remove-comments](https://leetcode.com/problems/remove-comments/) | 22/08/2023 10:14:33 | [](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) | |
81+
| [remove-comments](https://leetcode.com/problems/remove-comments/) | 22/08/2023 10:14:33 | [](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) | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/remove-comments/README.md) |
7782
| [unique-paths-iii](https://leetcode.com/problems/unique-paths-iii/) | 22/08/2023 10:14:33 | [](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) ||
7883
| [maximize-distance-to-closest-person](https://leetcode.com/problems/maximize-distance-to-closest-person/) | 22/08/2023 10:14:33 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/maximize-distance-to-closest-person/solution.h) |||
7984
| [car-fleet](https://leetcode.com/problems/car-fleet/) | 22/08/2023 10:14:33 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/car-fleet/solution.h) |||
8085
| [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 10:14:33 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/last-moment-before-all-ants-fall-out-of-a-plank/solution.h) |||
81-
| [freedom-trail](https://leetcode.com/problems/freedom-trail/) | 02/09/2023 11:28:16 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/freedom-trail/solution.h) |||
82-
| [ipo](https://leetcode.com/problems/ipo/) | 02/09/2023 10:54:56 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/ipo/solution.h) |||
83-
| [reverse-pairs](https://leetcode.com/problems/reverse-pairs/) | 02/09/2023 10:47:27 | [](https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/reverse-pairs/solution.h) |||

data.json

+41-25
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,46 @@
88
}
99
},
1010
"problem": {
11+
"poor-pigs": {
12+
"name": "poor-pigs",
13+
"url": "https://leetcode.com/problems/poor-pigs/",
14+
"date": "02/09/2023 11:34:16",
15+
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/poor-pigs/solution.h",
16+
"python": "",
17+
"tutorial": ""
18+
},
19+
"distinct-subsequences": {
20+
"name": "distinct-subsequences",
21+
"url": "https://leetcode.com/problems/distinct-subsequences/",
22+
"date": "02/09/2023 11:34:16",
23+
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/distinct-subsequences/solution.h",
24+
"python": "",
25+
"tutorial": ""
26+
},
27+
"freedom-trail": {
28+
"name": "freedom-trail",
29+
"url": "https://leetcode.com/problems/freedom-trail/",
30+
"date": "02/09/2023 11:28:16",
31+
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/freedom-trail/solution.h",
32+
"python": "",
33+
"tutorial": ""
34+
},
35+
"ipo": {
36+
"name": "ipo",
37+
"url": "https://leetcode.com/problems/ipo/",
38+
"date": "02/09/2023 10:54:56",
39+
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/ipo/solution.h",
40+
"python": "",
41+
"tutorial": ""
42+
},
43+
"reverse-pairs": {
44+
"name": "reverse-pairs",
45+
"url": "https://leetcode.com/problems/reverse-pairs/",
46+
"date": "02/09/2023 10:47:27",
47+
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/reverse-pairs/solution.h",
48+
"python": "",
49+
"tutorial": ""
50+
},
1151
"arithmetic-slices-ii-subsequence": {
1252
"name": "arithmetic-slices-ii-subsequence",
1353
"url": "https://leetcode.com/problems/arithmetic-slices-ii-subsequence/",
@@ -550,7 +590,7 @@
550590
"date": "22/08/2023 10:14:33",
551591
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/remove-comments/solution.h",
552592
"python": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-python/remove-comments/solution.py",
553-
"tutorial": ""
593+
"tutorial": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/remove-comments/README.md"
554594
},
555595
"unique-paths-iii": {
556596
"name": "unique-paths-iii",
@@ -583,30 +623,6 @@
583623
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/last-moment-before-all-ants-fall-out-of-a-plank/solution.h",
584624
"python": "",
585625
"tutorial": ""
586-
},
587-
"freedom-trail": {
588-
"name": "freedom-trail",
589-
"url": "https://leetcode.com/problems/freedom-trail/",
590-
"date": "02/09/2023 11:28:16",
591-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/freedom-trail/solution.h",
592-
"python": "",
593-
"tutorial": ""
594-
},
595-
"ipo": {
596-
"name": "ipo",
597-
"url": "https://leetcode.com/problems/ipo/",
598-
"date": "02/09/2023 10:54:56",
599-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/ipo/solution.h",
600-
"python": "",
601-
"tutorial": ""
602-
},
603-
"reverse-pairs": {
604-
"name": "reverse-pairs",
605-
"url": "https://leetcode.com/problems/reverse-pairs/",
606-
"date": "02/09/2023 10:47:27",
607-
"cpp": "https://github.com/goodstudyqaq/leetcode/blob/main/problems-cpp/reverse-pairs/solution.h",
608-
"python": "",
609-
"tutorial": ""
610626
}
611627
}
612628
}

script.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747

4848
# sort problem by date time
49-
datas["problem"] = dict(sorted(datas["problem"].items(), key=lambda x: x[1]["date"], reverse=True))
49+
datas["problem"] = dict(sorted(datas["problem"].items(), key=lambda x: datetime.strptime(x[1]["date"], "%d/%m/%Y %H:%M:%S"), reverse=True))
5050

5151

5252
# write data.json

0 commit comments

Comments
 (0)