Java Sorting (10 liner)
\npublic int maxTwoEvents(int[][] events) {\n\tint result = 0, maxOfCompletedEvents = 0;\n\tArrays.sort(events, (x,y)->x[0]-y[0]);   // Sort by Start time\n\tPr
```\npublic int maxTwoEvents(int[][] events) {\n\tint result = 0, maxOfCompletedEvents = 0;\n\tArrays.sort(events, (x,y)->x[0]-y[0]);   // Sort by Start time\n\tPriorityQueue<int[]> inProgressQueue = new PriorityQueue<>((x,y)->x[1]-y[1]); // sorted by end time\n\tfor(int[] currentEvent : events) {\n\t\twhile(!inProgressQueue.isEmpty() && inProgressQueue.peek()[1] < currentEvent[0])\n\t\t\tmaxOfCompletedEvents = Math.max(maxOfCompletedEvents, inProgressQueue.poll()[2]);\n\t\tresult = Math.max(result, maxOfCompletedEvents + currentEvent[2]);\n\t\tinProgressQueue.offer(currentEvent);\n\t}\n\treturn result;\n}\n```
[]