Event Log Analyzer
You're given a list of event logs. Each event has:
{
"timestamp": "2024-02-12T10:30:00Z",
"event_type": "click",
"user_id": "user123",
"properties": {"page": "/home"}
}
Part 1: summarize(events) — Group by event_type, count occurrences.
Returns: [{"event_type": "click", "count": 3}, ...]
Part 2: most_active_user(events) — Return the user_id with the most events.
Part 3: events_per_hour(events) — Return a dict mapping hour (0-23) to event count.
Hints
solution.py
Python ready
Test Output
▶
Click "Run Tests" to execute your code