C++ simple and concise solution
Please, upvote if you like it. Thanks :-)Complexity

Time complexity:
O(n* log(n))


Space complexity:
O(n)

Code
Please, upvote if you like it. Thanks :-)

# Complexity
- Time complexity:
O(n* log(n))

- Space complexity:
O(n)

# Code
```cpp []
vector<int> countMentions(int numberOfUsers, vector<vector<string>>& events) {
    sort(begin(events), end(events), [](auto& a, auto& b)
            { return stoi(a[1]) == stoi(b[1]) ? a[0] == "OFFLINE" : 
                                                stoi(a[1]) <= stoi(b[1]); } );
    int n = events.size(), cntAll = 0;
    vector<int> mentions(numberOfUsers, 0), offline(numberOfUsers, -1);
    for (const auto& e : events) {
        string message = e[0], users = e[2];
        int timestamp = stoi(e[1]);
        if (message == "MESSAGE") {
            if (users == "ALL")
                cntAll++;
            else if (users == "HERE") {
                for (int i = 0; i < numberOfUsers; i++)
                    if (offline[i] == -1 || offline[i] + 60 <= timestamp)
                        mentions[i]++;
            }
            else {
                stringstream ss(users);
                string curUser;
                while (ss >> curUser)
                    mentions[stoi(curUser.substr(2))]++;
            }
        }
        else
            offline[stoi(users)] = timestamp;
    }
    if (cntAll > 0)
        for (int i = 0; i < numberOfUsers; i++)
            mentions[i] += cntAll;
    return mentions;
}
```
['Array', 'Hash Table', 'Math', 'Sorting', 'Simulation', 'C++']