you give root binary tree n node node uniquely assign value 1 n you give sequence n value voyage desire preorder traversal binary treeAny node binary tree flip swapping leave right subtree for example flip node 1 follow effectflip small number node preorder traversal tree match voyagereturn list value flip node you return answer order if impossible flip node tree preorder traversal match voyage return list 1 Example 1input root 12 voyage 21output 1explanation it impossible flip node preorder traversal match voyageexample 2input root 123 voyage 132output 1explanation Flipping node 1 swap nod 2 3 preorder traversal match voyageexample 3input root 123 voyage 123output Explanation the tree preorder traversal match voyage node need flip ConstraintsThe number nod tree nn voyagelength1 n 1001 Nodeval voyagei nAll value tree uniqueall value voyage unique