this problem took a while.... java solution that makes sense and also isn't too complex
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
```java []
class Solution {
    public int[] countMentions(int numberOfUsers, List<List<String>> events) {
        events.sort((a, b) -> {
            int timeA = Integer.parseInt(a.get(1));
            int timeB = Integer.parseInt(b.get(1));

            if (timeA != timeB) return timeA - timeB; 

            String typeA = a.get(0);
            String typeB = b.get(0);

            if (typeA.equals(typeB)) return 0;
            if (typeA.equals("OFFLINE")) return -1;
            return 1;
        });

        Map<Integer, Integer> map = new HashMap<>();
        Map<Integer, Integer> online = new HashMap<>();

        int n = numberOfUsers;
        
        for (int i = 0; i < n; i++) {
            map.put(i, 0);
            online.put(i, 0);
        }

        for (List<String> event : events) {
            String e = event.get(0);
            int time = Integer.valueOf(event.get(1));
            String users = event.get(2);

            if (e.equals("MESSAGE")) {
                if (users.startsWith("id")) {
                    StringBuilder sb = new StringBuilder();

                    for (int i = 2; i < users.length(); i++) {
                        char c = users.charAt(i);
                        if (Character.isDigit(c)) sb.append(c);
                        else if (c == ' ') {
                            int user = Integer.valueOf(sb.toString());
                            map.put(user, map.get(user) + 1);
                            sb = new StringBuilder();
                        }
                    }

                    if (sb.length() > 0) {
                        int user = Integer.valueOf(sb.toString());
                        map.put(user, map.get(user) + 1);
                    }
                }
                
                else if (users.equals("ALL")) {
                    for (int i = 0; i < n; i++) map.put(i, map.get(i) + 1);
                }

                else if (users.equals("HERE")) {
                    for (int i = 0; i < n; i++) {
                        int offlineUntil = online.get(i);
                        if (time < offlineUntil) continue;  
                        map.put(i, map.get(i) + 1);         
                    }
                }
            }

            else if (e.equals("OFFLINE")) {
                int id = Integer.valueOf(users);
                online.put(id, time + 60);
            }
        }

        int[] arr = new int[n];
        for (int i = 0; i < n; i++) arr[i] = map.get(i);
        
        return arr;
    }
}
```
['Java']