Skip to content

Commit d0b941d

Browse files
authored
style: format code (doocs#1030)
1 parent d3f7728 commit d0b941d

File tree

51 files changed

+67
-59
lines changed

Some content is hidden

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

51 files changed

+67
-59
lines changed

.github/workflows/prettier.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,20 @@ jobs:
88
prettier:
99
runs-on: ubuntu-latest
1010

11+
permissions:
12+
contents: write
13+
1114
steps:
1215
- name: Checkout
1316
uses: actions/checkout@v3
1417
with:
1518
ref: ${{ github.head_ref }}
19+
repository: ${{ github.event.pull_request.head.repo.full_name }}
1620
fetch-depth: 0
1721

1822
- name: Prettify code
1923
uses: creyD/prettier_action@v4.3
2024
with:
2125
prettier_options: --write **/*.{js,ts,md}
22-
only_changed: True
26+
only_changed: true
2327
commit_message: "style: format code with prettier"

solution/0000-0099/0048.Rotate Image/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Solution:
7676
class Solution {
7777
public void rotate(int[][] matrix) {
7878
int n = matrix.length;
79-
for (int i = 0; i<n> > 1; ++i) {
79+
for (int i = 0; i < n >> 1; ++i) {
8080
for (int j = 0; j < n; ++j) {
8181
int t = matrix[i][j];
8282
matrix[i][j] = matrix[n - i - 1][j];

solution/0000-0099/0048.Rotate Image/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class Solution:
6464
class Solution {
6565
public void rotate(int[][] matrix) {
6666
int n = matrix.length;
67-
for (int i = 0; i<n> > 1; ++i) {
67+
for (int i = 0; i < n >> 1; ++i) {
6868
for (int j = 0; j < n; ++j) {
6969
int t = matrix[i][j];
7070
matrix[i][j] = matrix[n - i - 1][j];

solution/0000-0099/0048.Rotate Image/Solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ class Solution {
22
public:
33
void rotate(vector<vector<int>>& matrix) {
44
int n = matrix.size();
5-
for (int i = 0; i<n> > 1; ++i) {
5+
for (int i = 0; i < n >> 1; ++i) {
66
for (int j = 0; j < n; ++j) {
77
swap(matrix[i][j], matrix[n - i - 1][j]);
88
}

solution/0000-0099/0048.Rotate Image/Solution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Solution {
22
public void rotate(int[][] matrix) {
33
int n = matrix.length;
4-
for (int i = 0; i<n> > 1; ++i) {
4+
for (int i = 0; i < n >> 1; ++i) {
55
for (int j = 0; j < n; ++j) {
66
int t = matrix[i][j];
77
matrix[i][j] = matrix[n - i - 1][j];

solution/0100-0199/0137.Single Number II/Solution.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ int singleNumber(int* nums, int numsSize) {
77
count++;
88
}
99
}
10-
ans |= (uint)(count % 3) << i;
10+
ans |= (uint) (count % 3) << i;
1111
}
1212
return ans;
1313
}

solution/0300-0399/0374.Guess Number Higher or Lower/Solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/**
22
* Forward declaration of guess API.
33
* @param num your guess
44
* @return -1 if num is lower than the guess number

solution/0400-0499/0427.Construct Quad Tree/Solution.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Node {
88
Node* topRight;
99
Node* bottomLeft;
1010
Node* bottomRight;
11-
11+
1212
Node() {
1313
val = false;
1414
isLeaf = false;
@@ -17,7 +17,7 @@ class Node {
1717
bottomLeft = NULL;
1818
bottomRight = NULL;
1919
}
20-
20+
2121
Node(bool _val, bool _isLeaf) {
2222
val = _val;
2323
isLeaf = _isLeaf;
@@ -26,7 +26,7 @@ class Node {
2626
bottomLeft = NULL;
2727
bottomRight = NULL;
2828
}
29-
29+
3030
Node(bool _val, bool _isLeaf, Node* _topLeft, Node* _topRight, Node* _bottomLeft, Node* _bottomRight) {
3131
val = _val;
3232
isLeaf = _isLeaf;

solution/0500-0599/0544.Output Contest Matches/Solution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class Solution {
44
vector<string> team(n);
55
for (int i = 0; i < n; ++i) team[i] = to_string(i + 1);
66
for (; n > 1; n >>= 1) {
7-
for (int i = 0; i<n> > 1; ++i) {
7+
for (int i = 0; i < n >> 1; ++i) {
88
team[i] = "(" + team[i] + "," + team[n - 1 - i] + ")";
99
}
1010
}

solution/0500-0599/0558.Logical OR of Two Binary Grids Represented as Quad-Trees/Solution.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Node {
88
Node* topRight;
99
Node* bottomLeft;
1010
Node* bottomRight;
11-
11+
1212
Node() {
1313
val = false;
1414
isLeaf = false;
@@ -17,7 +17,7 @@ class Node {
1717
bottomLeft = NULL;
1818
bottomRight = NULL;
1919
}
20-
20+
2121
Node(bool _val, bool _isLeaf) {
2222
val = _val;
2323
isLeaf = _isLeaf;
@@ -26,7 +26,7 @@ class Node {
2626
bottomLeft = NULL;
2727
bottomRight = NULL;
2828
}
29-
29+
3030
Node(bool _val, bool _isLeaf, Node* _topLeft, Node* _topRight, Node* _bottomLeft, Node* _bottomRight) {
3131
val = _val;
3232
isLeaf = _isLeaf;

0 commit comments

Comments
 (0)