class Solution:
def maximumPopulation(self, logs: List[List[int]]) -> int:
nums = [0]*101
for birth,death in logs:
nums[birth-1950]+=1
nums[death-1950]-=1
for i in range(1,101):
nums[i]+=nums[i-1]
max_index = nums.index(max(nums))
return max_index+1950
与前两道题类似
题目提示
1950 <= birthi < deathi <= 2050
所以101位