Easy simple intutive solution 💯🧠⚡ || C++
Approach\n Describe your approach to solving the problem. \nFirst sort the events based on their start time and then store the sorted start times in a seperate 
# Approach\n<!-- Describe your approach to solving the problem. -->\nFirst sort the events based on their start time and then store the sorted start times in a seperate array where you can do a binary search on. Then create a suffix array which $$i^\\text{th}$$ value stores the maximum value whose start time is greater than or equal to start time of the $$i^\\text{th}$$ event, Then for every event do a binary search on the start times array and find the event after which the events are not intresecting ```zui``` , then the possible value by the current event is ```events[i][2]+maxis[zui]``` then the aim is to maximise this value , so we can iterate over all the events and do it.The other possible case is selecting a single event conisider this and do in a simple for loop. The final maximum possible value is stored in ```ans```\n\n# Complexity\n- Time complexity:$$O(nlogn)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(n)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int maxTwoEvents(vector<vector<int>>& events) {\n        ios::sync_with_stdio(false);\n        cin.tie(nullptr);\n        \n        int n = events.size();\n        sort(events.begin(),events.end());\n        int ans = INT_MIN;\n        vector<int>st(n);\n        for(int i=0;i<n;i++){\n            st[i] = events[i][0];\n        }\n        vector<int> maxis(n);\n        maxis[n-1] = events[n-1][2];\n        for(int i=n-2;i>=0;i--){\n            maxis[i] = max(maxis[i+1],events[i][2]);\n        }\n        for(int i=0;i<events.size();i++){\n            int zui = upper_bound(st.begin(),st.end(),events[i][1])-st.begin();\n            if(zui == n){\n                continue;\n            }\n            ans = max(ans,events[i][2]+maxis[zui]);\n        }\n        for(int i=0;i<n;i++){\n            ans = max(ans,events[i][2]);\n        }\n        return ans;\n    }\n};\n```
['Array', 'Binary Search', 'Dynamic Programming', 'Sorting', 'C++']