Skip to content

Commit a1322db

Browse files
committed
Added Python solution for "Range Addition II"
1 parent 35dd8f0 commit a1322db

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Python/Range Addition II.py

+14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,20 @@
11
from typing import List
22

33

4+
class Solution:
5+
"""
6+
Time: O(n)
7+
Memory: O(n)
8+
"""
9+
10+
def maxCount(self, rows: int, cols: int, ops: List[List[int]]) -> int:
11+
if not ops:
12+
return rows * cols
13+
14+
x, y = zip(*ops)
15+
return min(x) * min(y)
16+
17+
418
class Solution:
519
"""
620
Time: O(n)

0 commit comments

Comments
 (0)