The TransCompilator

Solved LeetCode program · 23 of 1,000

#0023 · Merge k Sorted Lists

Hard Heap (Priority Queue) chunk-01.md

Original English source

The first is a list of 1, 4, and 5. The second is a list of 1, 3, and 4. The third is a list of 2 and 6. The merged is an empty list of whole numbers.
For each value in first.
Place value into merged.

For each value in second.
Place value into merged.

For each value in third.
Place value into merged.

Sort merged. For each value in merged, report value.

Open in Playground Browse all 1,000 problems

Expected stdout

1
1
2
3
4
4
5
6