Java 100% faster solution ✅ O(N) time
class Solution {\n    public int maximumPopulation(int[][] logs) {\n        \n       int [] arr = new int[101];\n        for(int i = 0;i<logs.length ;i++)\n    
class Solution {\n    public int maximumPopulation(int[][] logs) {\n        \n       int [] arr = new int[101];\n        for(int i = 0;i<logs.length ;i++)\n        {\n           \n          \n                arr[logs[i][0]-1950]++;\n                arr[logs[i][1]-1950]--;\n           \n        }\n        for(int i = 1;i<101;i++)\n        {\n            arr[i]=arr[i-1]+arr[i];\n        }\n        int max=0,year=1950;\n        for(int i = 0;i<101;i++)\n        {\n            if(arr[i]>max){\n                max = arr[i];\n                year=i+1950;\n            }\n        }\n        return year;\n    }\n    \n}
['Java']