Problem 1743 · Medium

Restore the Array From Adjacent Pairs

Restore an array of distinct values from its unordered adjacent pairs.

Open the interactive visualisation