Java Line Sweep
Similiar to the meeting room problem\n\nclass Pair {\n    public int year;\n    public int birth;\n    public Pair(int year, int birth) {\n        this.year = y
Similiar to the `meeting room` problem\n```\nclass Pair {\n    public int year;\n    public int birth;\n    public Pair(int year, int birth) {\n        this.year = year;\n        this.birth = birth;\n    }\n}\nclass Solution {\n    public int maximumPopulation(int[][] logs) {\n        ArrayList<Pair> list = new ArrayList<>();\n        for (int[] log : logs) {\n            list.add(new Pair(log[0], 1));\n            list.add(new Pair(log[1], -1));\n        }\n        Collections.sort(list, (a, b) -> (a.year == b.year ? a.birth - b.birth : a.year - b.year));\n        int max = 0;\n        int year = 0;\n        int count = 0;\n        for (Pair p : list) {\n            if (p.birth == 1) {\n                count++;\n            } else {\n                count--;\n            }\n            if (count > max) {\n                max = count;\n                year = p.year;\n            }\n        }\n        return year;\n    }\n}\n```
[]