You are given two integer arrays inorder and postorder.
• inorder represents the nodes of a binary tree visited in inorder (left → root
→ right).
• postorder represents the same tree visited in postorder (left → right →
root).
Construct and return the original binary tree.
Input: inorder = [5,2,8,10,7] postorder = [5,8,7,10,2]
Output: [2,5,10,null,null,8,7]
Input: inorder = [4] postorder = [4]
Output: [4]
Accepted:
Submission: