You are given two integer arrays inorder and postorder where inorder is the inorder traversal of a binary tree and postorder is the postorder traversal of the same tree, construct and return the binary tree.
Example 1:
Input: inorder = [2,1,3,4], postorder = [2,4,3,1]
Output: [1,2,3,null,null,null,4]Example 2:
Input: inorder = [1], postorder = [1]
Output: [1]Constraints:
1 <= postorder.length == inorder.length <= 3000.-3000 <= inorder[i], postorder[i] <= 3000inorderandpostorderconsist of unique values.- Each value of
postorderalso appears ininorder. inorderis guaranteed to be the inorder traversal of the tree.postorderis guaranteed to be the postorder traversal of the tree.