Skip to content

Commit 9f97dc0

Browse files
authored
Merge branch 'doocs:main' into main
2 parents 9b356b7 + 0d6cfe4 commit 9f97dc0

File tree

9,460 files changed

+416509
-98388
lines changed

Some content is hidden

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

9,460 files changed

+416509
-98388
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ on:
44
push:
55
branches:
66
- main
7-
- docs
87
paths:
9-
- package.json
10-
- requirements.txt
118
- solution/**
129
- lcs/**
1310
- lcp/**
@@ -72,7 +69,7 @@ jobs:
7269
mkdocs build -f mkdocs-en.yml
7370
7471
- name: Deploy
75-
uses: peaceiris/actions-gh-pages@v3
72+
uses: peaceiris/actions-gh-pages@v4
7673
with:
7774
github_token: ${{ secrets.GITHUB_TOKEN }}
7875
publish_dir: ./site

.github/workflows/prettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Run prettier
3030
run: |
3131
git config --global core.quotepath off
32-
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.rs$|\.md$' || true)
32+
changed_files=$(git diff --name-only "${{ github.event.pull_request.base.sha }}" | grep -E '\.js$|\.ts$|\.php$|\.sql$|\.md$' || true)
3333
if [ -n "$changed_files" ]; then
3434
echo "Running prettier on the changed files"
3535
echo "$changed_files" | xargs -d '\n' npx prettier --write

.husky/_/husky.sh

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +0,0 @@
1-
#!/usr/bin/env sh
2-
if [ -z "$husky_skip_init" ]; then
3-
debug () {
4-
if [ "$HUSKY_DEBUG" = "1" ]; then
5-
echo "husky (debug) - $1"
6-
fi
7-
}
8-
9-
readonly hook_name="$(basename -- "$0")"
10-
debug "starting $hook_name..."
11-
12-
if [ "$HUSKY" = "0" ]; then
13-
debug "HUSKY env variable is set to 0, skipping hook"
14-
exit 0
15-
fi
16-
17-
if [ -f ~/.huskyrc ]; then
18-
debug "sourcing ~/.huskyrc"
19-
. ~/.huskyrc
20-
fi
21-
22-
readonly husky_skip_init=1
23-
export husky_skip_init
24-
sh -e "$0" "$@"
25-
exitCode="$?"
26-
27-
if [ $exitCode != 0 ]; then
28-
echo "husky - $hook_name hook exited with code $exitCode (error)"
29-
fi
30-
31-
if [ $exitCode = 127 ]; then
32-
echo "husky - command not found in PATH=$PATH"
33-
fi
34-
35-
exit $exitCode
36-
fi

.husky/commit-msg

100755100644
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx --no -- commitlint --edit $1
1+
npx --no -- commitlint --edit $1

.husky/pre-commit

100755100644
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
4-
npx lint-staged --allow-empty $1
1+
npx lint-staged --allow-empty $1

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ node_modules/
2323
/solution/2200-2299/2205.The Number of Users That Are Eligible for Discount/Solution.sql
2424
/solution/2200-2299/2230.The Users That Are Eligible for Discount/Solution.sql
2525
/solution/2200-2299/2252.Dynamic Pivoting of a Table/Solution.sql
26-
/solution/2200-2299/2253.Dynamic Unpivoting of a Table/Solution.sql
26+
/solution/2200-2299/2253.Dynamic Unpivoting of a Table/Solution.sql
27+
/solution/3100-3199/3150.Invalid Tweets II/Solution.sql
28+
/solution/3100-3199/3198.Find Cities in Each State/Solution.sql

.prettierrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"braceStyle": "1tbs",
1212
"endOfLine": "lf",
1313
"sqlKeywordCase": "upper",
14+
"sqlCanonicalSyntax": false,
1415
"overrides": [
1516
{
1617
"files": ["*.sql"],
1718
"options": { "parser": "mysql" }
1819
}
19-
]
20+
],
21+
"plugins": ["prettier-plugin-sql-cst", "@prettier/plugin-php"]
2022
}

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Use Node.js version 14 as the base image
2+
FROM node:14
3+
4+
# Set the working directory inside the container
5+
WORKDIR /app
6+
7+
# Copy package.json and package-lock.json (if present) to the working directory
8+
COPY package*.json ./
9+
10+
# Install npm dependencies
11+
RUN npm install
12+
13+
# Copy all files from the current directory to the working directory in the container
14+
COPY . .
15+
16+
# Expose port 80 to allow communication to/from the container
17+
EXPOSE 80
18+
19+
# Specify the command to run the application
20+
CMD ["npm", "start"]

README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ https://doocs.github.io/leetcode
9090
- [Shortest Path Visiting All Nodes](/solution/0800-0899/0847.Shortest%20Path%20Visiting%20All%20Nodes/README_EN.md) - `BFS`, `Minimum steps model`, `A* search`
9191
- [Cut Off Trees for Golf Event](/solution/0600-0699/0675.Cut%20Off%20Trees%20for%20Golf%20Event/README_EN.md) - `BFS`, `A* search`
9292
- [Minimum Cost to Make at Least One Valid Path in a Grid](/solution/1300-1399/1368.Minimum%20Cost%20to%20Make%20at%20Least%20One%20Valid%20Path%20in%20a%20Grid/README_EN.md) - `BFS using deque`
93-
- [Minimum Cost to Make at Least One Valid Path in a Grid](/solution/2200-2299/2290.Minimum%20Obstacle%20Removal%20to%20Reach%20Corner/README_EN.md) - `BFS using deque`
93+
- [Minimum Obstacle Removal to Reach Corner](/solution/2200-2299/2290.Minimum%20Obstacle%20Removal%20to%20Reach%20Corner/README_EN.md) - `BFS using deque`
9494
- [The Maze](/solution/0400-0499/0490.The%20Maze/README_EN.md) - `DFS, Flood fill`
9595
- [Word Search](/solution/0000-0099/0079.Word%20Search/README_EN.md) - `DFS`, `Backtracking`
9696
- [Path with Maximum Gold](/solution/1200-1299/1219.Path%20with%20Maximum%20Gold/README_EN.md) - `DFS`, `Backtracking`

basic/sorting/BubbleSort/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
<!-- tabs:start -->
1010

11+
#### Python3
12+
1113
```python
1214
def bubbleSort(arr):
1315
n = len(arr)
@@ -37,6 +39,8 @@ bubbleSort(arr)
3739
print(arr)
3840
```
3941

42+
#### Java
43+
4044
```java
4145
import java.util.Arrays;
4246

@@ -69,6 +73,8 @@ public class BubbleSort {
6973
}
7074
```
7175

76+
#### C++
77+
7278
```cpp
7379
#include <iostream>
7480
#include <vector>
@@ -97,6 +103,8 @@ int main() {
97103
}
98104
```
99105
106+
#### Go
107+
100108
```go
101109
package main
102110
@@ -122,6 +130,8 @@ func main() {
122130
}
123131
```
124132

133+
#### Rust
134+
125135
```rust
126136
fn bubble_sort(nums: &mut Vec<i32>) {
127137
let n = nums.len();
@@ -143,6 +153,8 @@ fn main() {
143153
}
144154
```
145155

156+
#### JavaScript
157+
146158
```js
147159
function bubbleSort(inputArr) {
148160
for (let i = inputArr.length - 1; i > 0; i--) {
@@ -168,6 +180,8 @@ const arr = [6, 3, 2, 1, 5];
168180
console.log(bubbleSort(arr));
169181
```
170182

183+
#### C#
184+
171185
```cs
172186
using static System.Console;
173187
namespace Pro;
@@ -217,5 +231,3 @@ public class Program
217231
```
218232

219233
<!-- tabs:end -->
220-
221-
<!-- end -->

0 commit comments

Comments
 (0)