wierdly long 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
```cpp []
class Solution {
public:
    void process_message(vector<int>& mentions, vector<int>& next_online,
                         vector<string> event) {
        int curr_time = stoi(event[1]);
        string ids = event[2];
        if (ids[0] == 'i') {
            for (int j = 2; j < ids.length();) {
                string s = "";
                int k = j;
                while (k < ids.length() && ids[k] != ' ') {
                    s += ids[k];
                    k++;
                }
                j=k+3;
                mentions[stoi(s)]++;
                if (next_online[stoi(s)] <= curr_time)
                    next_online[stoi(s)] = curr_time;
            }
        } else if (ids[0] == 'H') {
            for (int j = 0; j < mentions.size(); j++) {
                if (next_online[j] <= curr_time) {
                    mentions[j]++;
                    next_online[j] = curr_time;
                }
            }
        } else {
            for (int j = 0; j < mentions.size(); j++) {
                mentions[j]++;
            }
        }
    }
    vector<int> countMentions(int numberOfUsers,
                              vector<vector<string>>& events) {
        sort(events.begin(), events.end(),
             [&](vector<string> a, vector<string> b) {
                 if (stoi(a[1]) < stoi(b[1])) {
                     return true;
                 } else if (stoi(a[1]) == stoi(b[1])) {
                     return a[0] >= b[0];
                 } else {
                     return false;
                 }
             });
        for (auto i : events) {
            cout << i[0] << i[1] << i[2] << endl;
        }
        vector<int> mentions(numberOfUsers, 0);
        vector<int> next_online(numberOfUsers, 0);
        for (auto i : events) {
            if (i[0] == "MESSAGE") {
                process_message(mentions, next_online, i);
            } else {
                next_online[stoi(i[2])] = stoi(i[1]) + 60;
            }
        }
        return mentions;
    }
};
```
['C++']