Simple python3 solution
Complexity
Time complexity: O(m⋅log(m)+n2)

Space complexity: O(m+n)
where
n = numberOfUsers <= 100
m = events.length <= 100Code
# Complexity
- Time complexity: $$O(m \cdot \log(m) + n^2)$$
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: $$O(m + n)$$
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

where
`n = numberOfUsers <= 100`
`m = events.length <= 100`

# Code
```python3 []
class Solution:
    def countMentions(self, numberOfUsers: int, events: List[List[str]]) -> List[int]:
        data = sorted(
            (int(dt), msg == 'MESSAGE', i, mentions)
            for i, (msg, dt, mentions) in enumerate(events)
        )

        result = [0] * numberOfUsers
        all_mentions = 0
        online = set(range(numberOfUsers))
        offline = deque()

        for dt, is_msg, _, mentions in data:
            while offline and offline[0][1] <= dt:
                user, _ = offline.popleft()
                online.add(user)

            if is_msg:
                if mentions == 'ALL':
                    all_mentions += 1
                elif mentions == 'HERE':
                    for user in online:
                        result[user] += 1
                else:
                    for user_with_id in mentions.split():
                        user = int(user_with_id[2:])
                        result[user] += 1
            else:
                user = int(mentions)
                online.remove(user)
                offline.append((user, dt + 60))

        if all_mentions:
            for i in range(numberOfUsers):
                result[i] += all_mentions
        return result
```
['Hash Table', 'Design', 'Queue', 'Simulation', 'Python3']