Very easy c++ solution Check IT !
New method to use max-heap queue to min heap \n  int maxTwoEvents(vector>& events) {\n        int n = events.size();\n        int maxValue = 0;\n        int ans
# New method to use max-heap queue to min heap \n**  int maxTwoEvents**(vector<vector<int>>& events) {\n        int n = events.size();\n        int maxValue = 0;\n        int ans = 0;\n        // take pq (max heap)\n        priority_queue<pair<int, pair<int,int>>> pq;\n         sort(events.begin() , events.end());\n      // store passion -> in queue ->> {endTime , {startTime , value}}\n      \n      for(int i = 0 ; i< n ; i++){\n        // (-1)* value makes max heap to min heap \n        // we want min heap for first event that end earlier\n        while(!pq.empty() && (-1* pq.top().first) < events[i][0])\n        {\n          // take what fist event given me maxValue\n          maxValue = max(maxValue , pq.top().second.second);\n          pq.pop();\n          \n        }\n        \n        // push the first event taking this value as ans\n        ans = max(ans , maxValue+events[i][2]);\n        pq.push({-1*events[i][1] , {events[i][0], events[i][2]}});\n      }\n       return ans; \n    }
[]