Simple Approach | 0(n) | C++
class Solution {\npublic:\n    int maximumPopulation(vector>& logs) {\n        vector countPep(101);\n        int n = logs.size();\n        \n        for(int i=
class Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& logs) {\n        vector<int> countPep(101);\n        int n = logs.size();\n        \n        for(int i=0;i<n;i++) {\n            int st = logs[i][0];\n            int ed = logs[i][1];\n            \n            while(st<ed){\n                countPep[st-1950]++; st++;\n            }\n        }\n        int maxPep=0,ans=0;\n        \n        for(int i=0;i<=100;i++) {\n\t\t\n            if (countPep[i] > maxPep){\n                ans = i;\n                maxPep = countPep[i];\n            }\n        }\n        return ans+1950;\n    }\n};
[]