Skip to content

Commit dbeacb3

Browse files
committed
fix: python script
1 parent 66f2af4 commit dbeacb3

File tree

11 files changed

+162
-78
lines changed

11 files changed

+162
-78
lines changed

solution/0500-0599/0547.Number of Provinces/Solution.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ def findCircleNum(self, isConnected: List[List[int]]) -> int:
33
def dfs(i: int):
44
vis[i] = True
55
for j, x in enumerate(isConnected[i]):
6-
if not vis[j] and x:
6+
if not vis[j] and x:
77
dfs(j)
8-
8+
99
n = len(isConnected)
1010
vis = [False] * n
1111
ans = 0
1212
for i in range(n):
1313
if not vis[i]:
1414
dfs(i)
1515
ans += 1
16-
return ans
16+
return ans

solution/0800-0899/0887.Super Egg Drop/Solution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ def dfs(i: int, j: int) -> int:
1717
r = mid - 1
1818
return max(dfs(l - 1, j - 1), dfs(i - l, j)) + 1
1919

20-
return dfs(n, k)
20+
return dfs(n, k)

solution/1100-1199/1116.Print Zero Even Odd/Solution.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
from threading import Semaphore
22

3+
34
class ZeroEvenOdd:
45
def __init__(self, n):
56
self.n = n
67
self.z = Semaphore(1)
78
self.e = Semaphore(0)
89
self.o = Semaphore(0)
9-
10-
# printNumber(x) outputs "x", where x is an integer.
10+
11+
# printNumber(x) outputs "x", where x is an integer.
1112
def zero(self, printNumber: 'Callable[[int], None]') -> None:
1213
for i in range(self.n):
1314
self.z.acquire()
@@ -16,13 +17,13 @@ def zero(self, printNumber: 'Callable[[int], None]') -> None:
1617
self.o.release()
1718
else:
1819
self.e.release()
19-
20+
2021
def even(self, printNumber: 'Callable[[int], None]') -> None:
2122
for i in range(2, self.n + 1, 2):
2223
self.e.acquire()
2324
printNumber(i)
2425
self.z.release()
25-
26+
2627
def odd(self, printNumber: 'Callable[[int], None]') -> None:
2728
for i in range(1, self.n + 1, 2):
2829
self.o.acquire()

solution/1400-1499/1419.Minimum Number of Frogs Croaking/Solution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ def minNumberOfFrogs(self, croakOfFrogs: str) -> int:
1616
cnt[i - 1] -= 1
1717
if i == 4:
1818
x -= 1
19-
return -1 if x else ans
19+
return -1 if x else ans

solution/2400-2499/2432.The Employee That Worked on the Longest Task/Solution.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ def hardestWorker(self, n: int, logs: List[List[int]]) -> int:
66
if mx < t or (mx == t and ans > uid):
77
ans, mx = uid, t
88
last += t
9-
return ans
9+
return ans

solution/CONTEST_README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88

99
如果竞赛积分处于段位的临界值,在每周比赛结束重新计算后会出现段位升级或降级的情况。段位升级或降级后会自动替换对应的荣誉勋章。
1010

11-
| 段位 | 比例 | 段位名 | 国服分数线 | 勋章 |
12-
| ----- | ------ | -------- | --------- | --------------------------------------------------------------------------- |
13-
| LV3 | 5% | Guardian | &ge;2251.88 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Guardian.gif" style="width: 80px;" /></p> |
14-
| LV2 | 20% | Knight | &ge;1879.80 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Knight.gif" style="width: 80px;" /></p> |
15-
| LV1 | 75% | - | - | - |
11+
| 段位 | 比例 | 段位名 | 国服分数线 | 勋章 |
12+
| ---- | ---- | -------- | ----------- | ----------------------------------------------------------------------------------------------------------------------- |
13+
| LV3 | 5% | Guardian | &ge;2251.88 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Guardian.gif" style="width: 80px;" /></p> |
14+
| LV2 | 20% | Knight | &ge;1879.80 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Knight.gif" style="width: 80px;" /></p> |
15+
| LV1 | 75% | - | - | - |
1616

1717
力扣竞赛 **全国排名前 10** 的用户,全站用户名展示为品牌橙色。
1818

1919
## 赛后估分网站
2020

21-
- https://lcpredictor.herokuapp.com
22-
- https://lccn.lbao.site
21+
- https://lcpredictor.herokuapp.com
22+
- https://lccn.lbao.site
2323

2424
## 往期竞赛
2525

solution/CONTEST_README_EN.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ If you are in the top 5% of the contest rating, you’ll get the “Guardian”
1111

1212
If you are in the top 25% of the contest rating, you’ll get the “Knight” badge.
1313

14-
| Level | Proportion | Badge | Rating | |
15-
| ----- | ---------- | ---------- | -------------- | ----------------------------------------------------------------------------------------------------------------------- |
16-
| LV3 | 5\% | Guardian | &ge;2228.90 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Guardian.gif" style="width: 80px;" /></p> |
17-
| LV2 | 20\% | Knight | &ge;1842.73 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Knight.gif" style="width: 80px;" /></p> |
18-
| LV1 | 75\% | - | - | - |
14+
| Level | Proportion | Badge | Rating | |
15+
| ----- | ---------- | -------- | ----------- | ----------------------------------------------------------------------------------------------------------------------- |
16+
| LV3 | 5\% | Guardian | &ge;2228.90 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Guardian.gif" style="width: 80px;" /></p> |
17+
| LV2 | 20\% | Knight | &ge;1842.73 | <p><img alt="" src="https://fastly.jsdelivr.net/gh/doocs/leetcode@main/images/Knight.gif" style="width: 80px;" /></p> |
18+
| LV1 | 75\% | - | - | - |
1919

2020
For top 10 users (excluding LCCN users), your LeetCode ID will be colored orange on the ranking board. You'll also have the honor with you when you post/comment under discuss.
2121

solution/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2687,4 +2687,4 @@
26872687

26882688
## 版权
26892689

2690-
著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 [@yanglbme](mailto:contact@yanglibin.info) 获得授权,非商业转载请注明出处。
2690+
著作权归 [GitHub 开源社区 Doocs](https://github.com/doocs) 所有,商业转载请联系 [@yanglbme](mailto:contact@yanglibin.info) 获得授权,非商业转载请注明出处。

solution/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2685,4 +2685,4 @@ Press <kbd>Control</kbd>+<kbd>F</kbd>(or <kbd>Command</kbd>+<kbd>F</kbd> on the
26852685

26862686
## Copyright
26872687

2688-
[@Doocs](https://github.com/doocs)
2688+
[@Doocs](https://github.com/doocs)

0 commit comments

Comments
 (0)