Back to problems

Merge JSON Event Logs

Algorithm · Reddit · Easy

Problem You are monitoring a distributed system with multiple servers. Each server produces an event log that records actions along with their timestamps. You are given a JSON object logs. Every key is a serverId (a unique server identifier), and the associated value is an array of events representing that server's history. An event object contains: "time" – when the event happened "type" – the action (e.g., "send", "receive", "idle") "target" (optional) – the destination…

Checking your access…