Skip to content

Commit

Permalink
LeetCode
Browse files Browse the repository at this point in the history
  • Loading branch information
walkccc committed Jan 7, 2025
0 parents commit b27960d
Show file tree
Hide file tree
Showing 9,966 changed files with 245,900 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
21 changes: 21 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
Language: Cpp
BasedOnStyle: Google
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlignTrailingComments: true
ColumnLimit: 80
DerivePointerAlignment: false
LambdaBodyIndentation: OuterScope
---
Language: Java
AllowShortBlocksOnASingleLine: Empty
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlignTrailingComments: true
ColumnLimit: 100
IndentCaseLabels: true
SpaceAfterCStyleCast: true
92 changes: 92 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: LeetCode Workflow

# This workflow does the following:
# 1. Update the README with the latest progress.
# 2. Reset the commit history.
# 3. Build the *.md files by the code files and deploy with Mkdocs.

on:
push:
branches: [main]

jobs:
LeetFlow:
runs-on: ubuntu-latest
steps:
- name: Checkout LeetCode
uses: actions/checkout@v4
with:
repository: walkccc/LeetCode
path: LeetCode
ref: main

- name: Checkout LeetFlow
uses: actions/checkout@v4
with:
repository: walkccc/LeetFlow
path: LeetFlow
ref: main
token: ${{ secrets.ACCESS_TOKEN }}

- name: Run FlareSolverr Docker container
run: |
docker run -d \
--name=flaresolverr \
-p 8191:8191 \
-e LOG_LEVEL=info \
--restart unless-stopped \
ghcr.io/flaresolverr/flaresolverr:latest
- name: Set up Node v20
uses: actions/setup-node@v4
with:
node-version: 20.11.0

- name: Write README.md and Mkdocs *.md files
run: |
cd LeetFlow
npm install
npm run build -- --topic all
env:
CLIENT_EMAIL: ${{ secrets.CLIENT_EMAIL }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}

- name: Reset the commit history
run: |
cd LeetCode
git checkout --orphan orphan
git add --all
git config user.name "Peng-Yu Chen"
git config user.email $EMAIL
git commit -m 'LeetCode'
git branch -D main
git branch -m main
git push origin main -f
env:
EMAIL: ${{ secrets.EMAIL }}
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'
architecture: 'x64'
cache: 'pip'

- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r LeetFlow/requirements.txt
- name: Build LeetFlow/mkdocs to LeetFlow/site
run: mkdocs build -f LeetFlow/mkdocs/mkdocs.yml

- name: Deploy with Mkdocs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: LeetFlow/mkdocs/site
publish_branch: gh-pages
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
13 changes: 13 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"printWidth": 80,
"proseWrap": "always",
"singleQuote": true,
"overrides": [
{
"files": "*.md",
"options": {
"parser": "markdown"
}
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Peng-Yu Chen

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 43 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<div align="center">
<a href="https://walkccc.me/LeetCode/"><img src="https://i.imgur.com/IsS5xkZ.png" width=80 height=80 title="LeetCode" alt="LeetCode"></a>
<h1>LeetCode Solutions</h1>
<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>
<br/>
<br/>
<img src="https://img.shields.io/badge/Solved-3409/3415%20=%2099.82%25-blue.svg?style=flat-square" alt="Solved Percentage" />
<br/>
<img src="https://img.shields.io/badge/Easy-847/849-5CB85C.svg?style=flat-square" alt="Easy AC Count" />
<img src="https://img.shields.io/badge/Medium-1776/1779-F0AD4E.svg?style=flat-square" alt="Medium AC Count" />
<img src="https://img.shields.io/badge/Hard-786/787-D9534F.svg?style=flat-square" alt="Hard AC Count" />
</div>

## Getting Started

See the built page here: [LeetCode Solutions](https://walkccc.me/LeetCode/).

## Coding Style and Naming

Please see the [style guide](https://walkccc.me/LeetCode/styleguide/).

## Formatting

| Language | Formatter | Style Guide | Configuration |
| ---------- | ----------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| 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) |
| 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) |
| 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. |
| 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) |
| MySQL | N/A | N/A | N/A |

## Fun Facts

This website went live on February 23, 2019.

## License

Licensed under the MIT License, Copyright © 2019-2024
[P.-Y. Chen](https://github.com/walkccc).

<div align="center">
<sub>Assembled with ❤️ in New York.</sub>
</div>
Loading

0 comments on commit b27960d

Please sign in to comment.