Skip to content

Commit 08f389e

Browse files
authored
feat: update lc problems (doocs#2185)
1 parent af211c5 commit 08f389e

File tree

171 files changed

+2464
-2465
lines changed

Some content is hidden

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

171 files changed

+2464
-2465
lines changed

lcci/16.04.Tic-Tac-Toe/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,12 @@ class Solution:
7777
dg += v
7878
if i + j + 1 == n:
7979
udg += v
80-
if abs(rows[i]) == n or abs(cols[j]) == n or abs(dg) == n or abs(udg) == n:
80+
if (
81+
abs(rows[i]) == n
82+
or abs(cols[j]) == n
83+
or abs(dg) == n
84+
or abs(udg) == n
85+
):
8186
return c
8287
return 'Pending' if has_empty_grid else 'Draw'
8388
```

lcci/16.04.Tic-Tac-Toe/README_EN.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,12 @@ class Solution:
8585
dg += v
8686
if i + j + 1 == n:
8787
udg += v
88-
if abs(rows[i]) == n or abs(cols[j]) == n or abs(dg) == n or abs(udg) == n:
88+
if (
89+
abs(rows[i]) == n
90+
or abs(cols[j]) == n
91+
or abs(dg) == n
92+
or abs(udg) == n
93+
):
8994
return c
9095
return 'Pending' if has_empty_grid else 'Draw'
9196
```

solution/0000-0099/0002.Add Two Numbers/Solution.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@ function addTwoNumbers($l1, $l2) {
4444

4545
return $dummy->next;
4646
}
47-
}
47+
}

solution/0000-0099/0003.Longest Substring Without Repeating Characters/Solution.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ function lengthOfLongestSubstring($s) {
2121
}
2222
return $max;
2323
}
24-
}
24+
}

solution/0100-0199/0100.Same Tree/Solution.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function isSameTree($p, $q) {
2727
if ($p->val != $q->val) {
2828
return false;
2929
}
30-
return $this->isSameTree($p->left, $q->left) &&
31-
$this->isSameTree($p->right, $q->right);
30+
return $this->isSameTree($p->left, $q->left) && $this->isSameTree($p->right, $q->right);
3231
}
3332
}

solution/0100-0199/0105.Construct Binary Tree from Preorder and Inorder Traversal/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public:
249249
for (int i = 0; i < n; ++i) {
250250
d[inOrder[i]].push_back(i);
251251
}
252-
function<vector<TreeNode*>(int, int, int)> dfs = [&](int i,int j, int n) -> vector<TreeNode*> {
252+
function<vector<TreeNode*>(int, int, int)> dfs = [&](int i, int j, int n) -> vector<TreeNode*> {
253253
vector<TreeNode*> ans;
254254
if (n <= 0) {
255255
ans.push_back(nullptr);

solution/0100-0199/0105.Construct Binary Tree from Preorder and Inorder Traversal/README_EN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public:
239239
for (int i = 0; i < n; ++i) {
240240
d[inOrder[i]].push_back(i);
241241
}
242-
function<vector<TreeNode*>(int, int, int)> dfs = [&](int i,int j, int n) -> vector<TreeNode*> {
242+
function<vector<TreeNode*>(int, int, int)> dfs = [&](int i, int j, int n) -> vector<TreeNode*> {
243243
vector<TreeNode*> ans;
244244
if (n <= 0) {
245245
ans.push_back(nullptr);

solution/0100-0199/0175.Combine Two Tables/README_EN.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def combine_two_tables(person: pd.DataFrame, address: pd.DataFrame) -> pd.DataFr
102102
return pd.merge(left=person, right=address, how="left", on="personId")[
103103
["firstName", "lastName", "city", "state"]
104104
]
105-
106105
```
107106

108107
<!-- tabs:end -->

solution/0100-0199/0181.Employees Earning More Than Their Managers/README_EN.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ def find_employees(employee: pd.DataFrame) -> pd.DataFrame:
8888
emp = df[df["salary_x"] > df["salary_y"]]["name_x"]
8989

9090
return pd.DataFrame({"Employee": emp})
91-
9291
```
9392

9493
<!-- tabs:end -->

solution/0100-0199/0185.Department Top Three Salaries/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,6 @@ def top_three_salaries(
162162
return employee[employee["salary"] >= employee["cutoff"]].rename(
163163
columns={"name": "Employee", "salary": "Salary"}
164164
)[["Department", "Employee", "Salary"]]
165-
166165
```
167166

168167
<!-- tabs:end -->

0 commit comments

Comments
 (0)