Simple C++ Solution with explanation 
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:
    // Sort on the baisi of timestamp and if timestamp is same then Offline should come first
    static bool comp(const vector<string>&a, const vector<string>&b){
        if(stoi(a[1])==stoi(b[1])){
            if(a[0]==b[0]){
                return false;
            }
            return a[0]=="OFFLINE";
        }
        return stoi(a[1])<stoi(b[1]);
    }
    vector<int> countMentions(int n, vector<vector<string>>& events) {
        // Final Ans 
        vector<int>mentions(n, 0);

        // Store timestamp when user goes offline. Initial will be -60
        vector<int>offline(n, -60);

        // Sort
        sort(events.begin(), events.end(), comp);

        // Just do what is said in the question 
        for(auto &event: events){
            if(event[0]=="OFFLINE"){
                offline[stoi(event[2])]=stoi(event[1]);
            }else{
                if(event[2]=="ALL"){
                    for(int i=0;i<n;i++){
                        mentions[i]++;
                    }
                }else if(event[2]=="HERE"){
                    int t=stoi(event[1]);
                    for(int i=0;i<n;i++){
                        if(offline[i]+60<=t)
                            mentions[i]++;
                    }
                }else{
                    string u=event[2];
                    int start=0;
                    while(start<u.length()){
                        start+=2;
                        string temp="";
                        while(start<u.length()&&u[start]!=' '){
                            temp.push_back(u[start]);
                            start++;
                        }
                        //cout<<temp<<endl;
                        start++;
                        mentions[stoi(temp)]++;
                    }
                }
            }
        }

        return mentions;
    }
};
```
['C++']