Skip to content

Commit f61d2f5

Browse files
committed
LeetCode
0 parents  commit f61d2f5

File tree

10,315 files changed

+257008
-0
lines changed

Some content is hidden

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

10,315 files changed

+257008
-0
lines changed

.clang-format

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google
4+
AllowShortBlocksOnASingleLine: Empty
5+
AllowShortFunctionsOnASingleLine: Empty
6+
AllowShortIfStatementsOnASingleLine: false
7+
AllowShortLoopsOnASingleLine: false
8+
AlignTrailingComments: true
9+
ColumnLimit: 80
10+
DerivePointerAlignment: false
11+
LambdaBodyIndentation: OuterScope
12+
---
13+
Language: Java
14+
AllowShortBlocksOnASingleLine: Empty
15+
AllowShortFunctionsOnASingleLine: Empty
16+
AllowShortIfStatementsOnASingleLine: false
17+
AllowShortLoopsOnASingleLine: false
18+
AlignTrailingComments: true
19+
ColumnLimit: 100
20+
IndentCaseLabels: true
21+
SpaceAfterCStyleCast: true

.github/workflows/main.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: LeetCode Workflow
2+
3+
# This workflow does the following:
4+
# 1. Update the README with the latest progress.
5+
# 2. Reset the commit history.
6+
# 3. Build the *.md files by the code files and deploy with Mkdocs.
7+
8+
on:
9+
push:
10+
branches: [main]
11+
12+
jobs:
13+
LeetFlow:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout LeetCode
17+
uses: actions/checkout@v4
18+
with:
19+
repository: walkccc/LeetCode
20+
path: LeetCode
21+
ref: main
22+
23+
- name: Checkout LeetFlow
24+
uses: actions/checkout@v4
25+
with:
26+
repository: walkccc/LeetFlow
27+
path: LeetFlow
28+
ref: main
29+
token: ${{ secrets.ACCESS_TOKEN }}
30+
31+
- name: Run FlareSolverr Docker container
32+
run: |
33+
docker run -d \
34+
--name=flaresolverr \
35+
-p 8191:8191 \
36+
-e LOG_LEVEL=info \
37+
--restart unless-stopped \
38+
ghcr.io/flaresolverr/flaresolverr:latest
39+
40+
- name: Set up Node v20
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 20.11.0
44+
45+
- name: Write README.md and Mkdocs *.md files
46+
run: |
47+
cd LeetFlow
48+
npm install
49+
npm run build -- --topic all
50+
env:
51+
CLIENT_EMAIL: ${{ secrets.CLIENT_EMAIL }}
52+
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
53+
54+
- name: Reset the commit history
55+
run: |
56+
cd LeetCode
57+
git checkout --orphan orphan
58+
git add --all
59+
git config user.name "Peng-Yu Chen"
60+
git config user.email $EMAIL
61+
git commit -m 'LeetCode'
62+
git branch -D main
63+
git branch -m main
64+
git push origin main -f
65+
env:
66+
EMAIL: ${{ secrets.EMAIL }}
67+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
68+
69+
- name: Set up Python 3.12
70+
uses: actions/setup-python@v4
71+
with:
72+
python-version: '3.12'
73+
architecture: 'x64'
74+
cache: 'pip'
75+
76+
- name: Install Python dependencies
77+
run: |
78+
python3 -m pip install --upgrade pip
79+
python3 -m pip install -r LeetFlow/requirements.txt
80+
81+
- name: Append item_number custom sort to MkDocs-Material tags plugin
82+
run: |
83+
FILE_PATH=$(python3 -c "import material.plugins.tags; print(material.plugins.tags.__file__)") && \
84+
echo -e '\n\ndef item_number(mapping: Mapping):\n return int(mapping.item.title.split(".")[0])' >> "$FILE_PATH"
85+
86+
- name: Build LeetFlow/mkdocs to LeetFlow/site
87+
run: mkdocs build -f LeetFlow/mkdocs/mkdocs.yml
88+
89+
- name: Deploy with Mkdocs
90+
uses: peaceiris/actions-gh-pages@v3
91+
with:
92+
github_token: ${{ secrets.GITHUB_TOKEN }}
93+
publish_dir: LeetFlow/mkdocs/site
94+
publish_branch: gh-pages
95+
force_orphan: true
96+
user_name: 'github-actions[bot]'
97+
user_email: 'github-actions[bot]@users.noreply.github.com'

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"printWidth": 80,
3+
"proseWrap": "always",
4+
"singleQuote": true,
5+
"overrides": [
6+
{
7+
"files": "*.md",
8+
"options": {
9+
"parser": "markdown"
10+
}
11+
}
12+
]
13+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Peng-Yu Chen
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<div align="center">
2+
<a href="https://walkccc.me/LeetCode/"><img src="https://i.imgur.com/IsS5xkZ.png" width=70 height=70 title="LeetCode" alt="LeetCode" loading="lazy"></a>
3+
<h1>LeetCode Solutions</h1>
4+
5+
<p>
6+
💡 <i>Solutions to <a href="https://leetcode.com/problemset/all/">LeetCode</a> in C++23, Java, Python, MySQL, and TypeScript.
7+
This repository aims to provide code with <strong>good readability</strong> and <strong>consistent style</strong> over various topics
8+
and embraces new standards.</i>
9+
</p>
10+
11+
![LeetCode Progress](https://img.shields.io/badge/Solved-3526%2F3526%20(100.00%25)-323232?style=flat-square&logo=leetcode)
12+
<br/>
13+
![Easy](https://img.shields.io/badge/Easy-873%2F873-5CB85C?style=flat-square)
14+
![Medium](https://img.shields.io/badge/Medium-1829%2F1829-F0AD4E?style=flat-square)
15+
![Hard](https://img.shields.io/badge/Hard-824%2F824-D9534F?style=flat-square)
16+
<br/>
17+
<br/>
18+
![C++](https://img.shields.io/badge/C%2B%2B23-3461%20solutions-7DD3FC?style=flat-square&logo=cplusplus)
19+
![Java](https://img.shields.io/badge/Java-3337%20solutions-4298E2?style=flat-square&logo=java)
20+
![Python](https://img.shields.io/badge/Python%203-3131%20solutions-60A4FB?style=flat-square&logo=python)
21+
<br/>
22+
![TypeScript](https://img.shields.io/badge/TypeScript-69%20solutions-93C5FD?style=flat-square&logo=typescript)
23+
![MySQL](https://img.shields.io/badge/MySQL-306%20solutions-BAE6FD?style=flat-square&logo=mysql)
24+
</div>
25+
26+
## Getting Started
27+
28+
See the built page here: [LeetCode Solutions](https://walkccc.me/LeetCode/).
29+
30+
## Coding Style and Naming
31+
32+
Please see the [style guide](https://walkccc.me/LeetCode/styleguide/).
33+
34+
## Formatting
35+
36+
| Language | Formatter | Style Guide | Configuration |
37+
| ---------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
38+
| C++ | [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) | [Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html) | [`.clang-format`](https://github.com/walkccc/LeetCode/blob/main/.clang-format) |
39+
| Java | [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) | [Google Java Style Guide](https://google.github.io/styleguide/javaguide.html) | [`.clang-format`](https://github.com/walkccc/LeetCode/blob/main/.clang-format) |
40+
| Python | [`autopep8`](https://pypi.org/project/autopep8) | [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html) | Passing `--indent-size=2` for a better viewing experience in mobile devices. |
41+
| TypeScript | [Prettier](https://prettier.io) | [Google TypeScript Style Guide](https://google.github.io/styleguide/tsguide.html) | [`.prettierrc`](https://github.com/walkccc/LeetCode/blob/main/.prettierrc) |
42+
| MySQL | N/A | N/A | N/A |
43+
44+
## Fun Facts
45+
46+
This website went live on February 23, 2019.
47+
48+
## Contributing
49+
50+
This repository is a personal project and does not accept pull requests to
51+
maintain consistency in coding style and solutions. However, feel free to fork
52+
the repository and modify it as needed!
53+
54+
## License
55+
56+
Licensed under the MIT License, Copyright © 2019-2025
57+
[P.-Y. Chen](https://github.com/walkccc).
58+
59+
<div align="center">
60+
<sub>Assembled with ❤️ in New York.</sub>
61+
</div>

0 commit comments

Comments
 (0)