Skip to content

Commit a30014a

Browse files
committed
LeetCode
0 parents  commit a30014a

File tree

10,227 files changed

+254433
-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,227 files changed

+254433
-0
lines changed

.clang-format

+21
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

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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: Build LeetFlow/mkdocs to LeetFlow/site
82+
run: mkdocs build -f LeetFlow/mkdocs/mkdocs.yml
83+
84+
- name: Deploy with Mkdocs
85+
uses: peaceiris/actions-gh-pages@v3
86+
with:
87+
github_token: ${{ secrets.GITHUB_TOKEN }}
88+
publish_dir: LeetFlow/mkdocs/site
89+
publish_branch: gh-pages
90+
force_orphan: true
91+
user_name: 'github-actions[bot]'
92+
user_email: 'github-actions[bot]@users.noreply.github.com'

.prettierrc

+13
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

+21
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

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<div align="center">
2+
<a href="https://walkccc.me/LeetCode/"><img src="https://i.imgur.com/IsS5xkZ.png" width=80 height=80 title="LeetCode" alt="LeetCode"></a>
3+
<h1>LeetCode Solutions</h1>
4+
<span>💡 <i>Solutions to <a href="https://leetcode.com/problemset/all/">LeetCode</a> in C++20, Java, Python, MySQL, and TypeScript. This repository aims to provide code with <strong>good readability</strong> and <strong>consistent style</strong> over various topics and embraces new standards.</i></span>
5+
<br/>
6+
<br/>
7+
<img src="https://img.shields.io/badge/Solved-3493/3495%20=%2099.94%25-blue.svg?style=flat-square" alt="Solved Percentage" />
8+
<br/>
9+
<img src="https://img.shields.io/badge/Easy-867/868-5CB85C.svg?style=flat-square" alt="Easy AC Count" />
10+
<img src="https://img.shields.io/badge/Medium-1814/1815-F0AD4E.svg?style=flat-square" alt="Medium AC Count" />
11+
<img src="https://img.shields.io/badge/Hard-812/812-D9534F.svg?style=flat-square" alt="Hard AC Count" />
12+
</div>
13+
14+
## Getting Started
15+
16+
See the built page here: [LeetCode Solutions](https://walkccc.me/LeetCode/).
17+
18+
## Coding Style and Naming
19+
20+
Please see the [style guide](https://walkccc.me/LeetCode/styleguide/).
21+
22+
## Formatting
23+
24+
| Language | Formatter | Style Guide | Configuration |
25+
| ---------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
26+
| 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) |
27+
| 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) |
28+
| 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. |
29+
| 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) |
30+
| MySQL | N/A | N/A | N/A |
31+
32+
## Fun Facts
33+
34+
This website went live on February 23, 2019.
35+
36+
## Contributing
37+
38+
This repository is a personal project and does not accept pull requests to
39+
maintain consistency in coding style and solutions. However, feel free to fork
40+
the repository and modify it as needed!
41+
42+
## License
43+
44+
Licensed under the MIT License, Copyright © 2019-2025
45+
[P.-Y. Chen](https://github.com/walkccc).
46+
47+
<div align="center">
48+
<sub>Assembled with ❤️ in New York.</sub>
49+
</div>

0 commit comments

Comments
 (0)