Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Find the first element of nums - it will only appear once in adjacentPairs.
The adjacent pairs are like edges of a graph. Perform a depth-first search from the first element.