문제
It is very easy to produce the various traversals of a binary tree, however this problem requires you to produce the tree from the traversals. Specifically, given the pre-order and in-order traversals of a binary tree (not necessarily a binary search tree), reconstruct, if possible, the original tree.
For instance, the following tree will produce the traversals shown
E
/ \
D F
/ \
B G
/ \ \
A C I
/ \
H K
/
J
Preorder : EDBACFGIHKJ
Inorder : ABCDEFGHIJK
Postorder: ACBDHJKIGFE