Events arrive sorted by ts per user. Given a list of dicts {"user_id": str, "ts": str (ISO)} for ONE user, return a list of (start_ts, end_ts, event_count) tuples — one per session.
A new session starts whenever the gap from the previous event is more than 30 minutes. Sessions of length 1 (single event) get the same start_ts and end_ts.
The input is sorted ascending by ts. ts is ISO 8601, e.g. "2026-05-10T10:15:00".
What the tests check
6 on Run · 7 on Submit01empty input returns empty list
02single event is one session
03close events stay in one session
0431+ minute gap splits the session
05exactly 30 minutes does NOT split
06a steady stream of events stays one session even past 30 minutes total
Submit runs these and one more check you don’t see, so code written for the visible tests alone can still miss.