Skip to content

Commit 43420c5

Browse files
committed
Runtime: 92 ms (Top 15.46%) | Memory: 13.9 MB (Top 77.11%)
1 parent ce078c8 commit 43420c5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
# Runtime: 92 ms (Top 15.46%) | Memory: 13.9 MB (Top 77.11%)
12
class Solution:
23
def maximumPopulation(self, logs: List[List[int]]) -> int:
34
dates = []
45
for birth, death in logs:
56
dates.append((birth, 1))
67
dates.append((death, -1))
7-
8+
89
dates.sort()
910

1011
population = max_population = max_year = 0
@@ -13,5 +14,5 @@ def maximumPopulation(self, logs: List[List[int]]) -> int:
1314
if population > max_population:
1415
max_population = population
1516
max_year = year
16-
17-
return max_year
17+
18+
return max_year

0 commit comments

Comments
 (0)