Merge Sorted Streams with Timestamp Combining

Asked at Citadel · Coding Questions · Difficulty: Hard · Last asked Jan 16, 2026

You are given several input streams, each already sorted, and must combine them into one sorted output. The basic task merges plain values; the follow-up merges timestamped records and folds every group of records that share a timestamp into one output record. Throughout, `k` is the number of streams and `N` is the total number of elements.

Loading the problem…