Problem
logs[i] = [birth, death] gives the birth and death years of person i. A person counts toward the population of every year from birth to death - 1: they are not counted in the year they die. Return the year with the largest population. If several years tie, return the earliest one.
Example 1
- Input
- [[1993, 1999], [2000, 2010]]
- Output
- 1993
Example 2
- Input
- [[1950, 1961], [1960, 1971], [1970, 1981]]
- Output
- 1960
Constraints
1 <= logs.length <= 1001950 <= birth < death <= 2050