dictionary | simulation | intuitive Python3 approach. 
IntuitionWe can use simulation to solve this kind of problem.ApproachSort the input array by the timestamp since it didn't gaurantee this.
Use a dictionary offl
# Intuition
We can use simulation to solve this kind of problem. 

# Approach
Sort the input array by the timestamp since it didn't gaurantee this.
Use a dictionary `offline_users` to track current offline users and the time they went offline.

During checking, if it's offline message, then we just simply update the offline dictionary.

if it's a actual message, we first re-calculate the offline user using the current timestamp, then we process result for each of the event.

- If `ALL`, then every things add 1.
- If `HERE` then very things not in `offline_users` add 1
- if in other format, process each ID one by one.

# Complexity
- Time complexity:
O(N * numberOfUsers)
We process each event, within each event we might process all the users one by one. 

- Space complexity:
O(numberOfUsers) since we init the result array and offline users dict

# Comment
I suggest two improvements to this question:
1. We should be able to assume the timestamp ordering.
2. The id character infront from the id, such as `id1`,`id2` is very unecessary, should be just `int`. 

# Potential Optimizations
1. For `ALL` event, we don' have to count it each time, we can have a global acounter and add just once in the end.
2. The same for `HERE`, we don't have to operate on the entire `numberOfUsers`, we can just see how many times a user avoid `HERE` and process all at once in the end. 

# Code
```python3 []
class Solution:
    def countMentions(self, numberOfUsers: int, events: List[List[str]]) -> List[int]:
        res = [0] * numberOfUsers

        # let's just assume the input is timely ordered for now
        offline_users = {} #  id: timewent offline

        events.sort(key = lambda x: (int(x[1]), x[0] != "OFFLINE"))

        for e in events:
            if e[0] == 'MESSAGE':
                ts = int(e[1])
                offline_users = dict(filter(lambda item: ts - int(item[1]) < 60, offline_users.items()))

                if e[2] == 'ALL':
                    for i in range(numberOfUsers):
                        res[i] += 1
                elif e[2] == 'HERE':
                    for i in range(numberOfUsers):
                        if str(i) not in offline_users:
                            res[i] += 1
                else:
                    ids = e[2].split(' ')
                    for id in ids:
                        idx = int(id[2:])
                        res[idx] += 1
                        
            elif e[0] == 'OFFLINE':
                offline_users[e[2]] = e[1]
            else:
                raise("Unsupported Event Type")

            print(f"res: {res} \n offline_users: {offline_users}")
        return res

        
        
```
['Python3']