Skip to content

Commit 8e98826

Browse files
committed
style: format python code
1 parent 7e08c19 commit 8e98826

File tree

9 files changed

+20
-10
lines changed

9 files changed

+20
-10
lines changed

lcp/LCP 07. 传递信息/Solution.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ def numWays(self, n: int, relation: List[List[int]], k: int) -> int:
66
for a, b in relation:
77
dp[i][b] += dp[i - 1][a]
88
return dp[-1][-1]
9-

lcp/LCP 08. 剧情触发时间/Solution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class Solution:
2-
def getTriggerTime(self, increase: List[List[int]], requirements: List[List[int]]) -> List[int]:
2+
def getTriggerTime(
3+
self, increase: List[List[int]], requirements: List[List[int]]
4+
) -> List[int]:
35
increase.insert(0, [0, 0, 0])
46
m, n = len(increase), len(requirements)
57
for i in range(1, m):
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
class Solution:
2-
def expectNumber(self, scores: List[int]) -> int:
2+
def expectNumber(self, scores: List[int]) -> int:
33
return len(set(scores))

lcp/LCP 34. 二叉树染色/Solution.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# self.left = None
66
# self.right = None
77

8+
89
class Solution:
910
def maxValue(self, root: TreeNode, k: int) -> int:
1011
def dfs(root):
@@ -19,5 +20,5 @@ def dfs(root):
1920
for j in range(k + 1):
2021
ans[0] = max(ans[0], l[i] + r[j])
2122
return ans
22-
23+
2324
return max(dfs(root))

solution/0400-0499/0497.Random Point in Non-overlapping Rectangles/Solution.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
class Solution:
2-
32
def __init__(self, rects: List[List[int]]):
43
self.rects = rects
54
self.s = [0] * len(rects)

solution/1000-1099/1052.Grumpy Bookstore Owner/Solution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class Solution:
2-
def maxSatisfied(self, customers: List[int], grumpy: List[int], minutes: int) -> int:
2+
def maxSatisfied(
3+
self, customers: List[int], grumpy: List[int], minutes: int
4+
) -> int:
35
s = sum(a * b for a, b in zip(customers, grumpy))
46
cs = sum(customers)
57
t = ans = 0

solution/2200-2299/2250.Count Number of Rectangles Containing Each Point/Solution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class Solution:
2-
def countRectangles(self, rectangles: List[List[int]], points: List[List[int]]) -> List[int]:
2+
def countRectangles(
3+
self, rectangles: List[List[int]], points: List[List[int]]
4+
) -> List[int]:
35
d = defaultdict(list)
46
for x, y in rectangles:
57
d[y].append(x)

solution/2200-2299/2293.Min Max Game/Solution.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ def minMaxGame(self, nums: List[int]) -> int:
55
return nums[0]
66
t = []
77
for i in range(n >> 1):
8-
v = max(nums[i << 1], nums[i << 1 | 1]) if i & 1 else min(
9-
nums[i << 1], nums[i << 1 | 1])
8+
v = (
9+
max(nums[i << 1], nums[i << 1 | 1])
10+
if i & 1
11+
else min(nums[i << 1], nums[i << 1 | 1])
12+
)
1013
t.append(v)
1114
return self.minMaxGame(t)

solution/2300-2399/2300.Successful Pairs of Spells and Potions/Solution.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
class Solution:
2-
def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]:
2+
def successfulPairs(
3+
self, spells: List[int], potions: List[int], success: int
4+
) -> List[int]:
35
potions.sort()
46
m = len(potions)
57
ans = []

0 commit comments

Comments
 (0)