99: Construct a binary tree from preorder and inorder traversal
Given preorder and inorder traversal of a binary tree, construct the binary tree
Note:
binary treedoes not have duplicates
Example 1
Input: preoder = [1, 2, 3], inporder = [2, 1, 3]
Output: 1
/ \
2 3
Example 1
Input: preoder = [1, 2, 3], inporder = [3, 2, 1]
Output: 1
\
2
\
3