129. Construct Binary Tree from Inorder and Postorder Traversal

Given arrays inorder and postorder — tree traversals. Reconstruct the binary tree and return its root.
Example 1
Input: inorder = [-1], postorder = [-1]
Output: [-1]
Explanation: A tree with one node.
Example 2
Input: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3]
Output: [3,9,20,null,null,15,7]
Explanation: The root is the last element of postorder.
binary treemediumrecursiontree
JavaScript
Loading...
Line 1, Char 1