Construct Binary Tree From Preorder And Postorder Traversal
easy
1. You are given a partially written function to solve(Refer question video). 2. you will be given two arrays representing a valid PostOrder & PostOrder of a Binary Tree. Program is required to create a unique Binary Tree.
Constraints
0 <= Number of Nodes <= 10^9 -10^9 <= value of Node data <= 10^9 Valid PreOrder and PostOrder traversals.
Format
Input
Input is managed for you.
Output
Input is managed for you.
Example
Sample Input
7
1 3 2 5 7 6 4
4 2 1 3 6 5 7
Sample Output
2 -> 4