Available question text
Given unordered adjacent pairs from an array with unique elements, reconstruct the original array by treating values as nodes in a graph and the pairs as edges, then find an endpoint (degree 1) and traverse the path to recover the sequence. Constraints: n up to 1e5 and pairs are given in arbitrary order.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1743. Restore the Array From Adjacent Pairs
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source