Skip to content

Merge from master #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1,908 commits into
base: longsq
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1908 commits
Select commit Hold shift + click to select a range
6a93c09
test: 1931 solution
May 19, 2025
6715926
test: 3024, LCR 020 solution
May 19, 2025
d969683
test: 2353 solution
May 19, 2025
0b2bec4
fix: obj problem with muliple constructor
May 19, 2025
d622bd6
fix: golang any and [][]int
May 19, 2025
05e64bd
Merge pull request #148 from QuBenhao/147-golang-fix
QuBenhao May 19, 2025
e52cd6d
9.4.0
May 19, 2025
b3f5511
test: LCR 004 solution
May 19, 2025
b38bc02
test: 2360 solution
May 19, 2025
8d57b0f
test: 2412 solution
May 19, 2025
cec2da2
test: 2412 solution
QuBenhao May 19, 2025
65f3a8a
test: [20250520] Add (3355 LCR_028)
actions-user May 19, 2025
7a3e138
feat: implement double-linked-list-with-child python
QuBenhao May 20, 2025
dfffbf0
test: 335, LCR 028 solution
QuBenhao May 20, 2025
88fbd58
feat: golang doubleLinkedListNode
May 20, 2025
57b80de
fix: golang new submission
May 20, 2025
fd94385
test: 3355, LCR 028 solution
May 20, 2025
9b877bf
fix: golang any
May 20, 2025
009a82c
fix: golang any
May 20, 2025
81e1077
9.5.0
May 20, 2025
7c3cdeb
doc: update interface{} in golang
May 20, 2025
e3d8aa4
test: 2462 solution
May 20, 2025
5d1a721
test: 2506 solution
May 20, 2025
f66904e
test: 2537 solution
May 20, 2025
328ba3c
test: 2545 solution
May 20, 2025
0e00b52
test: 3159 solution
May 20, 2025
3d6e204
test: LCR 018 solution
May 20, 2025
c55c342
test: [20250521] Add (3356 LCR_103)
actions-user May 20, 2025
4ec7eab
test: 3356, LCR 103 solution
QuBenhao May 20, 2025
e1567a2
test: 3356, LCR 103 solution
QuBenhao May 20, 2025
2e541fd
fix: add ignore
May 21, 2025
c74cbbf
feat: add cookie expiration check and update mechanism
May 21, 2025
4e1987f
feat: add cookie expiration check and update mechanism
May 21, 2025
57a08bc
Update python/scripts/tools.py
QuBenhao May 21, 2025
dd28e6f
Update python/scripts/submit.py
QuBenhao May 21, 2025
9da3143
Update python/scripts/daily_submission.py
QuBenhao May 21, 2025
057d255
Update python/scripts/daily_auto.py
QuBenhao May 21, 2025
206d1f1
fix: code review
May 21, 2025
9dd6d1a
Merge pull request #151 from QuBenhao/150-cookie
QuBenhao May 21, 2025
3468bf8
9.6.0
May 21, 2025
1d62162
!feat: 149 contest support (#152)
QuBenhao May 21, 2025
74665b6
fix: bs4
May 21, 2025
8666351
docs: update interview
May 21, 2025
e9e27f2
doc: update interview
QuBenhao May 21, 2025
cc3a0e6
test: [20250522] Add (3362 LCR_087)
actions-user May 21, 2025
6c5d29f
test: 3362, LCR 087 solution
QuBenhao May 21, 2025
6b21611
test: 3362, LCR 087 solution
QuBenhao May 21, 2025
79d7846
fix: contest use alpha
May 22, 2025
cf432c2
test: multithreading 1114
May 22, 2025
19abdad
test: multithreading 1115
May 22, 2025
a3195e0
test: multithreading 1116
May 22, 2025
0681706
test: multithreading 1117
May 22, 2025
45ec48d
test: multithreading 1195
May 22, 2025
f83f652
test: [20250523] Add (3068 LCR_119)
actions-user May 22, 2025
b6de6b7
test: 3068, LCR 119 solution
QuBenhao May 22, 2025
303242a
test: 3068, LCR 119 solution
QuBenhao May 22, 2025
071ae88
test: LRU/LFU template
QuBenhao May 23, 2025
6f4ea1a
test: [20250524] Add (2942 LCR_058 LCR_104)
actions-user May 23, 2025
36c162d
test: 2942, LCR 058, LCR 104 solution
QuBenhao May 24, 2025
56b382d
test: 2942, LCR 058, LCR 104 solution
QuBenhao May 24, 2025
3ad2aaf
test: [20250525] Add (2131 LCR_069 LCR_112)
actions-user May 24, 2025
5f1314c
test: biweekly contest 157 solution
QuBenhao May 25, 2025
8cb795f
test: 2131, LCR 069, LCR 112 solution
QuBenhao May 25, 2025
d28f16b
test: weekly contest 451 solution
QuBenhao May 25, 2025
ccfaf18
test: weekly contest 451 solution
QuBenhao May 25, 2025
131d0a8
test: 2131, LCR 069, LCR 112 solution
QuBenhao May 25, 2025
34e1b38
test: biweekly contest 157 solution
QuBenhao May 25, 2025
035cab0
test: biweekly contest 157 solution
QuBenhao May 25, 2025
d61e585
test: [20250526] Add (1857 LCR_077)
actions-user May 25, 2025
d6eabcb
test: 1857, LCR 077 solution
QuBenhao May 25, 2025
5104370
test: multiprocess
May 26, 2025
b971581
test: add golang concurrency
May 26, 2025
209dc5c
test: 1857, LCR 077 solution
May 26, 2025
5a970ac
test: add golang concurrency
May 26, 2025
21274fd
test: add golang concurrency
May 26, 2025
57cca6a
test: add cpp interview.h
QuBenhao May 26, 2025
737f96d
test: go concurrency 03
QuBenhao May 26, 2025
138eb7c
test: go concurrency 04
QuBenhao May 26, 2025
f1e83f1
test: go concurrency 05
QuBenhao May 26, 2025
443dae1
test: [20250527] Add (2894 LCR_006)
actions-user May 26, 2025
af954f0
test: 2894, LCR 006 solution
QuBenhao May 26, 2025
0ee3858
doc: interview update
May 27, 2025
57e61f0
doc: interview update
May 27, 2025
953ea6b
doc: interview update
May 27, 2025
5da8273
test: 3396 solution
May 27, 2025
f1c1956
test: [20250528] Add (3372 LCR_030)
actions-user May 27, 2025
a1d4ce3
test: 3372, LCR 030 solution
QuBenhao May 27, 2025
b803828
test: 3372, LCR 030 solution
May 28, 2025
5b87635
test: 3372, LCR 030 solution
May 28, 2025
b63e116
test: 3372, LCR 030 solution
May 28, 2025
9c822bb
test: [20250529] Add (3373 LCR_041)
actions-user May 28, 2025
c56d11b
test: 3373, LCR 041 solution
QuBenhao May 28, 2025
ad528b2
test: 3373, LCR 041 solution
QuBenhao May 28, 2025
0422b84
test: 3373, LCR 041 solution
QuBenhao May 29, 2025
d177922
test: 3373, LCR 041 solution
May 29, 2025
05361a1
doc: update interview
May 29, 2025
9e5abe3
test: [20250530] Add (2359 LCR_071)
actions-user May 29, 2025
47285da
test: 2359, LCR 071 solution
May 30, 2025
afe8a5d
test: 2359, LCR 071 solution
May 30, 2025
c655aea
test: 2359, LCR 071 solution
May 30, 2025
5974fc1
test: 2359, LCR 071 solution
May 30, 2025
513723b
doc: update templates
QuBenhao May 30, 2025
dc11d71
test: [20250531] Add (909)
actions-user May 30, 2025
879bde0
test: LCR 029, LCR 056, LCR 091 solution
QuBenhao May 30, 2025
8e1181f
test: 909 solution
QuBenhao May 30, 2025
0ef5dfe
test: [20250601] Add (2929)
actions-user May 31, 2025
d1c0063
test: 2929 solution
QuBenhao May 31, 2025
df84ce7
test: add multi-threading c++
QuBenhao Jun 1, 2025
aefd1e0
test: [20250602] Add (135)
actions-user Jun 1, 2025
5accf01
test: 135 solution
QuBenhao Jun 2, 2025
a606dd4
doc: templates update
QuBenhao Jun 2, 2025
0602227
test: 4 solution
QuBenhao Jun 2, 2025
8ccfc39
test: 394 solution
QuBenhao Jun 2, 2025
9f5e20d
test: 84 solution
QuBenhao Jun 2, 2025
c1b2aa9
test: 295, 45 solution
QuBenhao Jun 2, 2025
ab0ec39
test: [20250603] Add (1298 62 LCR_114)
actions-user Jun 2, 2025
a4abf7b
test: 763, 300, 139, 70 solution
QuBenhao Jun 2, 2025
2a01603
test: 1298 solution
Jun 3, 2025
5f43813
test: [20250604] Add (3403 LCR_114)
actions-user Jun 3, 2025
0e4ba53
test: 3403 solution
QuBenhao Jun 4, 2025
7bdb002
fix: leetcode script env
QuBenhao Jun 4, 2025
d71f327
test: add multi-threading primes
QuBenhao Jun 4, 2025
77d091f
test: add multi-threading primes
QuBenhao Jun 4, 2025
23e6bda
test: [20250605] Add (1061 LCR_114)
actions-user Jun 4, 2025
9a85471
test: 1061 solution
QuBenhao Jun 4, 2025
0881c0b
test: LCR 114 solution
QuBenhao Jun 4, 2025
2420798
feat: support c++23
QuBenhao Jun 5, 2025
c9eb899
test: add python tips
QuBenhao Jun 5, 2025
1604fd5
test: [20250606] Add (2434 LCR_115)
actions-user Jun 5, 2025
98b4a4f
test: 2434 solution
QuBenhao Jun 5, 2025
b9cec90
test: 2434 solution
QuBenhao Jun 6, 2025
31992b2
test: LCR 115 solution
QuBenhao Jun 6, 2025
f399edc
test: [20250607] Add (3170)
actions-user Jun 6, 2025
4e04046
test: 3170 solution
QuBenhao Jun 7, 2025
497b772
test: [20250608] Add (386)
actions-user Jun 7, 2025
92aa4ae
test: 3572, 3573, 3574, 3575 contest#bi158
QuBenhao Jun 7, 2025
87b03b6
test: 3572, 3573, 3574, 3575 solution
QuBenhao Jun 8, 2025
2395480
test: 386 solution
QuBenhao Jun 8, 2025
e19c3b0
test: 3572, 3573, 3574, 3575 contest#453
QuBenhao Jun 8, 2025
c6527ee
test: 3576, 3577, 3578, 3579 solution
QuBenhao Jun 8, 2025
430d94a
test: 132 solution
QuBenhao Jun 8, 2025
73b72fd
test: 2707 solution
QuBenhao Jun 8, 2025
a8de745
feat: favorite (#154)
QuBenhao Jun 8, 2025
2593340
9.7.0
Jun 8, 2025
76b7791
test: 3578, 3579 solution
QuBenhao Jun 8, 2025
2895b65
test: 3578, 3579 solution
QuBenhao Jun 8, 2025
73e2ebf
test: [20250609] Add (440)
actions-user Jun 8, 2025
a98c10f
test: 440 solution
QuBenhao Jun 8, 2025
8761f80
test: 3196 solution
QuBenhao Jun 9, 2025
8f3d984
test: 1298 solution
QuBenhao Jun 9, 2025
eb99d1c
test: [20250610] Add (3442)
actions-user Jun 9, 2025
2e1fbe3
test: 3442 solution
QuBenhao Jun 9, 2025
8b1deeb
refactor: update contest problem info extraction (#156)
QuBenhao Jun 10, 2025
ab559eb
feat: optimize contest question processing with parallel execution
QuBenhao Jun 10, 2025
6db1143
9.8.0
Jun 10, 2025
e76129d
test: [20250611] Add (3445)
actions-user Jun 10, 2025
6deb184
test: 3445 solution
QuBenhao Jun 10, 2025
ad2c53d
test: 3445 solution
QuBenhao Jun 11, 2025
98351ab
feat!: 157 daily problem design (#158)
QuBenhao Jun 11, 2025
29e9566
10.0.0
Jun 11, 2025
e6dd04f
doc: update doc
QuBenhao Jun 11, 2025
5188807
fix: necessary dependency
QuBenhao Jun 11, 2025
9b06c0b
refactor: allow c++23
QuBenhao Jun 11, 2025
c38ea7f
fix: get_solution_code
QuBenhao Jun 11, 2025
c394bc8
test: 792 solution
QuBenhao Jun 11, 2025
394f7fb
10.0.1
Jun 11, 2025
28c5869
fix: update page size limit in input handling
QuBenhao Jun 11, 2025
5a6f52f
test: 792 solution
QuBenhao Jun 11, 2025
bda75a0
test: [20250612] Add (3423)
actions-user Jun 11, 2025
241565b
test: 3423 solution
QuBenhao Jun 11, 2025
1be5b70
test: 2767 solution
QuBenhao Jun 11, 2025
c506b4b
fix: bazel cache issue & daily
QuBenhao Jun 12, 2025
b631202
10.0.2
Jun 12, 2025
b647870
test: 3574 solution
QuBenhao Jun 12, 2025
340904a
feat: cpp memory improve (#160)
QuBenhao Jun 12, 2025
5ae865f
10.1.0
Jun 12, 2025
2537ee8
test: 943 solution
QuBenhao Jun 12, 2025
040fbe6
test: [20250613] Add (2616)
actions-user Jun 12, 2025
5de4938
test: 2616 solution
QuBenhao Jun 12, 2025
5e910f7
fix: leetcode force get problem
QuBenhao Jun 12, 2025
82d5262
test: 943 solution
QuBenhao Jun 12, 2025
9f11ef3
fix: line break
QuBenhao Jun 13, 2025
80c7d19
test: 2125 solution
QuBenhao Jun 13, 2025
022b4f3
fix: contest template
QuBenhao Jun 13, 2025
d920ff7
test: 3531 solution
QuBenhao Jun 13, 2025
d4c75ad
test: 3532 solution
QuBenhao Jun 13, 2025
e7c9319
test: 3533 timeout
QuBenhao Jun 13, 2025
769c6bb
test: 3533 solution
QuBenhao Jun 13, 2025
aa1503f
test: 3533 solution
QuBenhao Jun 13, 2025
cf38bdc
test: [20250614] Add (2566)
actions-user Jun 13, 2025
90ec84c
test: 2566 solution
QuBenhao Jun 13, 2025
2afcabf
test: 1642 solution
QuBenhao Jun 13, 2025
c3ed36d
test: 1483 solution
QuBenhao Jun 13, 2025
75d2246
test: 3534 solution
QuBenhao Jun 14, 2025
477175f
test: 3553 solution
QuBenhao Jun 14, 2025
1da56e7
test: 2103 solution
QuBenhao Jun 14, 2025
3c4ad5a
test: [20250615] Add (1432)
actions-user Jun 14, 2025
79bfa94
test: 1432 solution
QuBenhao Jun 14, 2025
3e980a6
test: 1504 solution
QuBenhao Jun 15, 2025
6a5e57b
test: 1504 solution
QuBenhao Jun 15, 2025
c7d112d
test: 316 solution
QuBenhao Jun 15, 2025
9774a03
test: 3582, 3583, 3584, 3585 solution
QuBenhao Jun 15, 2025
aca2ac6
test: 3582, 3583, 3584, 3585 solution
QuBenhao Jun 15, 2025
604013c
test: 3582, 3583, 3584, 3585 solution
QuBenhao Jun 15, 2025
7b202d8
test: 3582, 3583, 3584, 3585 solution
QuBenhao Jun 15, 2025
22c7f95
test: 1732 solution
QuBenhao Jun 15, 2025
a553d8f
test: [20250616] Add (2016)
actions-user Jun 15, 2025
96c0083
test: 2016 solution
QuBenhao Jun 15, 2025
bc2ce0e
test: add 321
QuBenhao Jun 15, 2025
ae709b8
test: 321 solution
QuBenhao Jun 16, 2025
5d0057a
test: 321
QuBenhao Jun 16, 2025
bb5ad88
test: 402 solution
QuBenhao Jun 16, 2025
2400f65
test: go build ignore
QuBenhao Jun 16, 2025
70b8af3
test: 1206 solution
QuBenhao Jun 16, 2025
404023d
test: 1206 solution
QuBenhao Jun 16, 2025
d88730c
fix: java groovy path on Windows
QuBenhao Jun 16, 2025
748fa1c
10.1.1
Jun 16, 2025
1c381e6
test: [20250617] Add (3405)
actions-user Jun 16, 2025
15f6fe5
test: 3405 solution
QuBenhao Jun 16, 2025
9ceb2ea
fix: use path.join for file paths in tests
QuBenhao Jun 17, 2025
d85887a
test: add 808, 813
QuBenhao Jun 17, 2025
2d593ea
fix: handle old python
QuBenhao Jun 17, 2025
ad89ad7
test: 808 solution
QuBenhao Jun 17, 2025
dffb5c8
test: 813 solution
QuBenhao Jun 17, 2025
a28bd3a
fix: maven problem folder and bazel plans
QuBenhao Jun 17, 2025
4f4e305
10.1.2
Jun 17, 2025
5199224
test: 813 solution
QuBenhao Jun 17, 2025
b36683f
test: [20250618] Add (2966)
actions-user Jun 17, 2025
9d10421
test: 2966 solution
QuBenhao Jun 18, 2025
2f38636
test: 1 solution
QuBenhao Jun 18, 2025
dd8c79f
test: 791 solution
QuBenhao Jun 18, 2025
cc41073
test: 21 cpp memory
QuBenhao Jun 18, 2025
fffdd6d
test: 24, 25 cpp memory
QuBenhao Jun 18, 2025
6637ea5
test: [20250619] Add (2294)
actions-user Jun 18, 2025
5075d66
test: 2294 solution
QuBenhao Jun 18, 2025
103d3e4
test: 2294 solution
QuBenhao Jun 18, 2025
a247bba
test: reformat
QuBenhao Jun 19, 2025
b47be1d
test: cpp
QuBenhao Jun 19, 2025
6a12133
test: 775 solution
QuBenhao Jun 19, 2025
0347a36
test: 775
QuBenhao Jun 19, 2025
b2df641
test: [20250620] Add (3443)
actions-user Jun 19, 2025
53e7921
test: 3443 solution
QuBenhao Jun 19, 2025
bc40a9b
test: 879 solution
QuBenhao Jun 20, 2025
09b76ab
test: 864 solution
QuBenhao Jun 20, 2025
8e8c28a
test: [20250621] Add (3085)
actions-user Jun 20, 2025
20d5fc6
test: 3085 solution
QuBenhao Jun 21, 2025
c339a4a
test: 2385 solution
QuBenhao Jun 21, 2025
dfd89d7
test: 978 solution
QuBenhao Jun 21, 2025
fd36ad8
test: 1662 solution
QuBenhao Jun 21, 2025
a8b28d0
test: 1662 template
QuBenhao Jun 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 5 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Enable Bzlmod for every Bazel command
common --enable_bzlmod
test --cxxopt=-std=c++20 --test_timeout=3 --test_output=all
build --cxxopt=-std=c++20
run --cxxopt=-std=c++20
400 changes: 400 additions & 0 deletions .clang-format

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .clangd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CompileFlags:
Add: [-std=c++23]
18 changes: 15 additions & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,19 @@ jobs:
python
qubhjava
typescript
rust
go.mod
go.sum
pom.xml
WORKSPACE
MODULE.bazel
tsconfig.json
package.json
jest.config.ts
Cargo.toml
data
${{ secrets.PROBLEM_FOLDER || 'problems' }}
${{ secrets.PREMIUM_FOLDER || 'premiums' }}
daily-${{ secrets.PROBLEM_FOLDER || 'problems' }}.json

- name: Set up Python environment
uses: actions/setup-python@v2
Expand All @@ -42,17 +46,23 @@ jobs:
pip install -r python/requirements.txt

- name: Run script
id: script
env:
COOKIE: ${{ secrets.COOKIE }}
PUSH_SERVER: ${{ secrets.PUSH_SERVER }}
PUSH_KEY: ${{ secrets.PUSH_KEY || '' }}
PROBLEM_FOLDER: ${{ secrets.PROBLEM_FOLDER || '' }}
LANGUAGES: ${{secrets.LANGUAGES || ''}}
LOG_LEVEL: ${{secrets.LOG_LEVEL || 'INFO'}}
run: |
set +e
python python/scripts/daily_auto.py > /tmp/msg
python python/scripts/daily_auto.py > /tmp/msg 2>&1
status=$?
cat /tmp/msg
echo "QUESTION_IDS=$(grep 'Add question:' /tmp/msg | cut -d '[' -f 6 | cut -d ']' -f 1 | tr '\n' ' ' | sed 's/ $//')" >> $GITHUB_ENV
echo "question lines: $(grep 'Add question:' /tmp/msg)"
echo "question ids: $(grep 'Add question:' /tmp/msg | cut -d '[' -f 6 | cut -d ']' -f 1)"
echo "QUESTION_IDS=$(grep 'Add question:' /tmp/msg | cut -d '[' -f 6 | cut -d ']' -f 1 | tr '\n' ' ' | sed 's/ $//')"
exit $status

- name: Commit files
Expand All @@ -64,7 +74,9 @@ jobs:
echo "No changes to commit"
exit 0
fi
git commit -m "[$(TZ=Asia/Shanghai date +%Y%m%d)] Add daily LeetCode problem"
cat /tmp/msg
echo "question_ids: ${{ env.QUESTION_IDS }}"
git commit -m "test: [$(TZ=Asia/Shanghai date +%Y%m%d)] Add (${{ env.QUESTION_IDS }})"

- name: Push changes
run: |
Expand Down
26 changes: 20 additions & 6 deletions .github/workflows/daily_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,23 @@ jobs:
python
qubhjava
typescript
rust
go.mod
go.sum
pom.xml
WORKSPACE
MODULE.bazel
tsconfig.json
package.json
jest.config.ts
Cargo.toml
data
${{ secrets.PROBLEM_FOLDER || 'problems' }}
${{ secrets.PREMIUM_FOLDER || 'premiums' }}
daily-${{ secrets.PROBLEM_FOLDER || 'problems' }}.json
BUILD
extensions.bzl
solutions.bzl
get_daily_path.py

- name: Set up Python environment
uses: actions/setup-python@v2
Expand All @@ -40,7 +48,7 @@ jobs:
continue-on-error: true
uses: actions/setup-go@v5
with:
go-version: '1.22'
go-version: '1.24'

- name: Set up JDK
continue-on-error: true
Expand All @@ -58,7 +66,12 @@ jobs:
continue-on-error: true
run: |
npm install
npm audit fix --force

- name: Set up rust-cargo
continue-on-error: true
uses: actions-rs/cargo@v1.0.1
with:
command: check

- name: Install python dependencies
run: |
Expand All @@ -82,8 +95,8 @@ jobs:
bazelrc: |
build --color=yes
build --show_timestamps
build --cxxopt=-std=c++20
test --cxxopt=-std=c++20
build --cxxopt=-std=c++23
test --cxxopt=-std=c++23

- name: Run script
env:
Expand All @@ -93,6 +106,7 @@ jobs:
PROBLEM_FOLDER: ${{ secrets.PROBLEM_FOLDER || '' }}
LANGUAGES: ${{secrets.LANGUAGES || ''}}
USER: ${{ secrets.USER }}
LOG_LEVEL: ${{secrets.LOG_LEVEL || 'INFO'}}
run: |
set +e
python python/scripts/daily_submission.py &> /tmp/msg
Expand All @@ -109,7 +123,7 @@ jobs:
echo "No changes to commit"
exit 0
fi
git commit -m "[$(TZ=Asia/Shanghai date +%Y%m%d)] Add daily problem solution"
git commit -m "test: [$(TZ=Asia/Shanghai date +%Y%m%d)] Add daily problem solution"

- name: Push changes
run: |
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Semantic Release

on:
workflow_dispatch:
pull_request:
types: [closed]
branches:
- master

jobs:
release:
runs-on: ubuntu-latest
concurrency:
group: release
cancel-in-progress: true
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Python Semantic Release
# Adjust tag with desired version if applicable. Version shorthand
# is NOT available, e.g. vX or vX.X will not work.
uses: python-semantic-release/python-semantic-release@v9.8.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Cleanup old tags and releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch all tags
git fetch --tags

# Get the list of tags sorted by date
tags=$(git for-each-ref --sort=-taggerdate --format '%(refname:short)' refs/tags)

# Get the current date in seconds since epoch
current_date=$(date +%s)

# Initialize counters
count=0
max_count=3
max_days=7

for tag in $tags; do
# Get the tag date in seconds since epoch
tag_date=$(git log -1 --format=%at $tag)

# Calculate the age of the tag in days
age_days=$(( (current_date - tag_date) / 86400 ))

if [ $age_days -le $max_days ] && [ $count -lt $max_count ]; then
count=$((count + 1))
else
# Delete the tag locally and remotely
git tag -d $tag
git push origin :refs/tags/$tag
fi
done

- name: Delete Draft Releases
uses: hugo19941994/delete-draft-releases@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.name
.idea/
.cache/
__pycache__/
.env
python/dev/tmp*
Expand All @@ -10,7 +11,6 @@ bazel-bin
bazel-LeetCode
bazel-out
bazel-testlogs
MODULE.bazel
MODULE.bazel.lock
bazel-LeetCode/
/bazel-LeetCode/
Expand Down Expand Up @@ -48,4 +48,8 @@ bazel-LeetCode/
package-lock.json
bin/

.clwb/
# bazel
.clwb/

# rust
Cargo.lock
5 changes: 5 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
load("@daily//:daily.bzl", "FOLDER", "DAILY_PROBLEM", "PLANS")
load("//:solutions.bzl", "generate_cc_tests", "gen_daily")

gen_daily(folder = FOLDER, problem = DAILY_PROBLEM, plans = PLANS)
generate_cc_tests()
Loading