#t462. 求后序遍历
求后序遍历
Background
Special for beginners, ^_^
Description
Given the preorder and inorder traversal sequences of a binary tree, output its postorder traversal sequence.
Format
Input
The input consists of two lines.
The first line is a string denoting the preorder traversal of the tree;
The second line is a string denoting the inorder traversal of the tree.
The nodes of the tree are all represented by lowercase letters, and the length is less than 50.
Output
Output a single line: the postorder traversal sequence of the tree.
Samples
abdec
dbeac
debca
Limitation
1s, 1024KiB for each test case.