Range Addition
CODE:\n\n  public int maximumPopulation(int[][] logs) {\n        int[] year=new int[2051];\n        \n        for(int[] log:logs){\n            year[log[0]]+=1;
CODE:\n```\n  public int maximumPopulation(int[][] logs) {\n        int[] year=new int[2051];\n        \n        for(int[] log:logs){\n            year[log[0]]+=1;\n            year[log[1]]-=1;\n        }\n        \n        int maxPopulation=year[1950];\n        int maxYear=1950;\n        \n        for(int i=1950;i<year.length;i++){\n            year[i]+=year[i-1];  // prefixSum\n            \n            if(year[i]>maxPopulation){\n                maxPopulation=year[i];\n                maxYear=i;\n            }\n        }\n        return maxYear;\n    }\n```\n\nComplexity:\n\t`time:O(n) and space:O(2051)`
['Java']