there integer array num consist n unique element forget however remember pair adjacent element numsyou give 2D integer array adjacentPairs size n 1 adjacentPairsi ui vi indicate element ui vi adjacent numsIt guarantee adjacent pair element numsi numsi1 exist adjacentpair numsi numsi1 numsi1 numsi the pair appear orderreturn original array num if multiple solution return Example 1input adjacentpairs 213432output 1234explanation this array adjacent pair adjacentpairsnotice adjacentpairsi lefttoright orderexample 2input adjacentpair 421431output 2413explanation there negative numbersanother solution 3142 acceptedexample 3input adjacentpair 100000100000output 100000100000 Constraintsnumslength nadjacentpairslength n 1adjacentpairsilength 22 n 105105 numsi ui vi 105There exist num adjacentpairs pair