Brute | Online Array | Concise Code
Code
# Code
```python3 []
class Solution:
    def countMentions(self, N: int, events: List[List[str]]) -> List[int]:
        events.sort(key=lambda x : (-int(x[1]),x[0]),reverse=True)
        # print(events)
        res=[0]*N
        online=[0]*N
        allcount=0
        for ty,ts,s in events:
            if ty=="MESSAGE":
                if s=="ALL": # online+offline
                    allcount+=1
                elif s=="HERE": # online
                    for i in range(N):
                        if online[i]<=int(ts):res[i]+=1
                else:
                    mention_ids=s.split()
                    for id in mention_ids:
                        res[int(id[2:])]+=1
            else:
                online[int(s)]=int(ts)+60
            # print(online,res)

        for i in range(N):res[i]+=allcount
        return res
```
['Design', 'Sorting', 'Python3']