Simple prefix-sum solution | C# | +96% efficient
Intuition\n Describe your first thoughts on how to solve this problem. \nEvery log indicates a birth and death year of a person. We need to calculate for every 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nEvery log indicates a birth and death year of a person. We need to calculate for every year how many people are alive.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe\'ll create a prefix sum of population over the years - in a given year how many people are alive (B-D -> born on same year or previous year - died this year)\n\n### Please upvote if you liked the simplicity of the solution\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(1)\n\n# Code\n```\npublic class Solution {\n    public int MaximumPopulation(int[][] logs) {\n        int[] population = new int[101];\n        foreach (var log in logs)\n        {\n            population[log[0] - 1950]++;\n            population[log[1] - 1950]--;\n        }\n        Console.WriteLine("here..");\n\n        int maxYear = 0;\n        for (int i = 1; i < population.Length; i++)\n        {\n            population[i] += population[i - 1];\n            maxYear = population[i] > population[maxYear] ? i : maxYear;\n        }\n\n        return (1950 + maxYear);\n    }\n}\n```
['Array', 'Counting', 'C#']