[Python] Solution
IntuitionRecord the user sign in time point.
online[i] means the user i was online since time online[i].
If user i go offline on t, then set online[i] = t + 60.
# Intuition
Record the user sign in time point.
`online[i]` means the user `i` was online since time `online[i]`.
If user `i` go offline on `t`, then set `online[i] = t + 60`.

# Approach
If message ALL users, then we increment `count_all`
If message HERE online users, then we check if `online[i] <= t` for every users.

Finally we increment `count_all` to all `count[i]`, and return the result `count[i]`.

# Complexity
- Time complexity:
`O(n + eloge + id)`
`e = event.size`
`id` is the number of id mentioned in message`

- Space complexity:
`O(n)`

# Code
```python3 []
class Solution:
    def countMentions(self, n: int, events: List[List[str]]) -> List[int]:
        events.sort(key = lambda e: [int(e[1]), e[0] == 'MESSAGE'])
        count = [0] * n
        online = [0] * n
        count_all = 0
        for e,t,m in events:
            t = int(t)
            if e == 'OFFLINE':
                online[int(m)] = t + 60
            else:
                if m == 'ALL':
                    count_all += 1
                elif m == 'HERE':
                    for i in range(n):
                        count[i] += online[i] <= t
                else:
                    for i in m.split():
                        count[int(i[2:])] += 1
        for i in range(n):
            count[i] += count_all
        return count
```

['Python3']