Merge K Sorted (Key, Value) Lists with Later Override

Asked at Oracle · Coding Questions · Difficulty: Medium · Last asked Nov 20, 2025

Merge `k` lists, each holding `(key, value)` pairs sorted ascending by key. On key collision across lists, the later list (higher index) overrides the earlier list. Return one sorted output list. Asked in an OCI Consultant Engineer phone screen.

Loading the problem…