LC 23
Merge k Sorted Lists
Hard · LC 1–100
Candidate solution routes
Linked-List Pointer Rewiring
Invariant: prev bounds the correctly processed chain and cur is the first unprocessed node; every original node belongs to exactly one side and remains reachable.
candidate confidence: 0.625 · metadata_only
K-way merge heap
Invariant: The heap contains exactly the first unconsumed item of every source that still has data; the global minimum unconsumed item is therefore in the heap.
candidate confidence: 0.740 · metadata_only
Merge-sort cross-half counting
Invariant: At combine entry, both halves are sorted and internally counted. The relation pointer only advances; at exit every cross pair is counted exactly once and the parent range is sorted.
candidate confidence: 0.740 · metadata_only
Divide, recurse, and combine
Invariant: solve(lo,hi) returns a complete summary conforming to its domain contract; combine depends only on child summaries and accounts for every cross-domain contribution exactly once.
candidate confidence: 0.630 · metadata_only
How to use this page
Read the statement and constraints first, then validate recognition signals, invariant, and complexity. Candidate score is not correctness evidence.