Parse and group log lines by thread id, then sort by timestamp

Problem

You are given N log lines (strings). Each line follows the format:

<timestamp> <thread_id> <level> <message>
  • timestamp: an ISO-8601 time string, e.g. 2024-01-01T10:00:00Z ...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: