Construct binary tree from inorder and postorder traversal
Given the inorder and postorder traversals of a binary tree with distinct values, rebuild the tree. The last postorder value is the root; its position in the inorder list splits the left and right subtrees. Write it first with list slicing, then with index bounds and a value-to-index map so it runs in linear time.
No answer yet. Write the first one; the best answer gets endorsed.
