Simple Java Solution - With Comments (Left Max + Right Max)
\nclass Solution {\n    public int maxTwoEvents(int[][] events) {\n        // for any timestamp - find max of values to left and max of values to right\n\n     
```\nclass Solution {\n    public int maxTwoEvents(int[][] events) {\n        // for any timestamp - find max of values to left and max of values to right\n\n        Arrays.sort(events, (a,b)->a[1]-b[1]);// Sort by end time - to know what events happened previously\n        TreeMap<Integer, Integer> maxSeenMapOnLeft = new TreeMap<>();\n        int result = 0;\n        int maxSeenValue = 0;\n        for(int[] event: events){\n            int eventVal = event[2];\n            if(eventVal>=maxSeenValue){\n                maxSeenValue= eventVal;\n                maxSeenMapOnLeft.put(event[1],maxSeenValue); // save max value event seen so far at end timestamp\n            }\n        }\n        \n        Arrays.sort(events, (a,b)->b[0]-a[0]);// Sort by start time but in descending order - as we parse events and store max value of future events to current event start timestamp\n        int maxSeenRight = 0;\n        for(int[] event: events){\n            int eventVal = event[2];\n            if(eventVal>=maxSeenRight){\n                maxSeenRight= eventVal;\n                Integer maxOnLeftKey = (maxSeenMapOnLeft.floorKey(event[0]-1));//skip one timestamp unit as start and end can\'t be same\n                if(maxOnLeftKey!=null){\n                    result = Math.max(result, maxSeenMapOnLeft.get(maxOnLeftKey) + maxSeenRight);\n                }\n            }\n        }\n        return Math.max(maxSeenValue,result);\n    }\n}\n```
[]