Easy sorting and min heap solution
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```java []
class Solution {
    public int maxTwoEvents(int[][] events) {
        //We are sorting the events based on the START time of the event
        Arrays.sort(events, (a, b) -> Integer.compare(a[0], b[0]));
        //We are storing in the priority queue based on the END time of the event (min priority queue)
        PriorityQueue<int[]> pq = new PriorityQueue<>((a, b) -> Integer.compare(a[0], b[0]));

        int maxVal = 0, ans = 0;

        for (int[] event : events) {
            int start = event[0], end = event[1], value = event[2];

            while (!pq.isEmpty() && pq.peek()[0] < start) { //maxVal will basically store the maximum "value" of the event having same start time
                maxVal = Math.max(maxVal, pq.poll()[1]);
            }

            ans = Math.max(ans, maxVal + value);
            pq.add(new int[]{end, value});
        }

        return ans;
    }
}
```
['Sorting', 'Heap (Priority Queue)', 'Java']