Maximum overlapping intervals
\nLogic is pretty simple\n\n- Create a Min heap with an Int[] array. This will be a 2 dimentional array which will store the year and population increment/decre
\nLogic is pretty simple\n\n- Create a Min heap with an `Int[]` array. This will be a 2 dimentional array which will store the `year` and `population increment/decrement`\n- Go through the list of intervals (all the people) and follow these \n\t* When an interval starts (Person is born) add `[Year, +1]` to min heap\n\t* When an interval ends (Person is dead) add `[Year, -1]` to min heap\n\nAfter this, we iterate through the heap and calculate the population like\n```java\n    public int solution(List<Person> people) {\n\n        Queue<int[]> queue = new PriorityQueue<>();\n        for (Person p : people) {\n            // When interval starts we add 1 to total interval count\n            queue.add(new int[]{p.birth, 1});\n            // When interval ends we remove 1 from total interval count\n            queue.add(new int[]{p.death, -1});\n        }\n\n        int currentPopulation = 0;\n        int maxPopulation = 0;\n        int year = 0;\n\n        while (!queue.isEmpty()) {\n            int[] poll = queue.poll();\n            currentPopulation += poll[1];\n            if (currentPopulation > maxPopulation) {\n                maxPopulation = currentPopulation;\n                year = poll[0];\n            }\n        }\n        return year;\n\n    }\n```\n
['Java']