Python3 O(N)
Steps\n1. For each log, update an array which stores the population changes in each year. The first index corresponds to the year 1950, and the last to the year
### Steps\n1. For each log, update an array which stores the population changes in each year. The first index corresponds to the year 1950, and the last to the year 2050. \n1. Then, iterate through the years while updating the running sum, max population and year of that max population.\n1. Return that year.\n\n```\nclass Solution:\n    def maximumPopulation(self, logs: List[List[int]]) -> int:\n        # the timespan 1950-2050 covers 101 years\n\t\tdelta = [0] * 101\n\n\t\t# to make explicit the conversion from the year (1950 + i) to the ith index\n        conversionDiff = 1950 \n\t\t\n        for l in logs:\n\t\t\t# the log\'s first entry, birth, increases the population by 1\n            delta[l[0] - conversionDiff] += 1 \n\t\t\t\n\t\t\t# the log\'s second entry, death, decreases the population by 1\n            delta[l[1] - conversionDiff] -= 1\n        \n        runningSum = 0\n        maxPop = 0\n        year = 1950\n\t\t\n\t\t# find the year with the greatest population\n        for i, d in enumerate(delta):\n            runningSum += d\n\t\t\t\n\t\t\t# since we want the first year this population was reached, only update if strictly greater than the previous maximum population\n            if runningSum > maxPop:\n                maxPop = runningSum\n                year = conversionDiff + i\n\t\t\t\t\n        return year\n```\n\nThis idea works because we have a limited number of years (101) to track. If this number were higher, we could instead sort then iterate, for an O(nlogn) complexity with O(n) memory solution.
['Python', 'Python3']