1743. Restore the Array From Adjacent Pairs
Description
**Input:** adjacentPairs = [[2,1],[3,4],[3,2]]
**Output:** [1,2,3,4]
**Explanation:** This array has all its adjacent pairs in adjacentPairs.
Notice that adjacentPairs[i] may not be in left-to-right order.**Input:** adjacentPairs = [[4,-2],[1,4],[-3,1]]
**Output:** [-2,4,1,-3]
**Explanation:** There can be negative numbers.
Another solution is [-3,1,4,-2], which would also be accepted.**Input:** adjacentPairs = [[100000,-100000]]
**Output:** [100000,-100000]ac
Previous1742. Maximum Number of Balls in a BoxNext1744. Can You Eat Your Favorite Candy on Your Favorite Day?
Last updated