c++, easy using array
\nclass Solution {\npublic:\n    int maximumPopulation(vector>& log) {\n        int arr[2051]={0};\n        \n        for(int i=0;i<log.size();i++){\n          
\nclass Solution {\npublic:\n    int maximumPopulation(vector<vector<int>>& log) {\n        int arr[2051]={0};\n        \n        for(int i=0;i<log.size();i++){\n            int a=log[i][0];\n            int b=log[i][1];\n            \n            for(int j=a;j<b;j++) arr[j]++;\n        }\n        \n        int maxv=0;\n        int val=-1;\n        for(int i=1950;i<=2050;i++) {\n            if(arr[i]>maxv){\n                maxv=arr[i];\n                val=i;\n            }\n        }\n        \n        return val;\n    }\n};\n
[]