c++ || o(n) || Brute force
TC : O(n)\n\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs) {\n        int arr[101]={0};\n        for(vector<int> log : logs){\
**TC : O(n)**\n```\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs) {\n        int arr[101]={0};\n        for(vector<int> log : logs){\n            arr[log[0]-1950]++;\n            arr[log[1]-1950]--;\n        }\n        int max=0,year,cnt=0;\n        for(int i=0;i<101;i++){\n            cnt+=arr[i];\n            if(cnt>max)\n                max=cnt,year=i;\n        }\n        return year+1950;\n    }\n};\n```\n**Brute force**\n```\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs) { \n        vector<int> map(101, 0);\n        for(auto &log : logs){\n            for(int i = log[0]; i < log[1]; ++i){\n                map[i - 1950]++;\n            }\n        }\n        int max = 0, ans;\n        for(int i = 0; i <= 100; ++i){\n            if(max < map[i]){\n                max = map[i];\n                ans = i;\n            }\n        }\n        return ans+1950;\n    }\n};\n```\n**Feel free to ask any question in the comment section.**\nI hope that you\'ve found the solution useful.\nIn that case, **please do upvote and encourage me** to on my quest to document all leetcode problems\uD83D\uDE03\nHappy Coding :)\n
['C', 'C++']