Simple 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:
    static bool cmp(vector<string>& a, vector<string>& b) {
        if (stoi(a[1]) == stoi(b[1])) {
            return a[0] > b[0];
        }
        return stoi(a[1]) < stoi(b[1]);
    }

    vector<int> countMentions(int n, vector<vector<string>>& events) {
        vector<int> ans(n, 0);
        map<int, int> offline;
        sort(events.begin(), events.end(), cmp);
        for (auto& it : events) {
            string type = it[0];
            int time = stoi(it[1]);
            if (type == "OFFLINE") {
                offline[stoi(it[2])] = time + 60;
            } else {
                string mention = it[2];
                if (mention == "ALL") {
                    for (int i = 0; i < n; i++) {
                        ans[i]++;
                    }
                } else if (mention == "HERE") {
                    for (int i = 0; i < n; i++) {
                        if (time >= offline[i] || offline[i] == 0) {
                            ans[i]++;
                        }
                    }
                } else {
                    stringstream ss(mention);
                    string token;
                    while (ss >> token) {
                        ans[stoi(token.substr(2))]++;
                    }
                }
            }
        }
        return ans;
    }
};

```
['C++']