Construct Binary Tree from Inorder and Postorder Traversal Solutions in PythonNumber 106Difficulty MediumAcceptance 47.3%Link LeetCodeOther languages C++, GoSolutionsPython solution by haoel/leetcodedef buildTree(self, inorder, postorder): if inorder: i = inorder.index(postorder.pop()) root = TreeNode(inorder[i]) root.right = self.buildTree(inorder[i+1:], postorder) root.left = self.buildTree(inorder[:i], postorder) return rootdef buildTree(self, inorder, postorder): if inorder: i = inorder.index(postorder.pop()) root = TreeNode(inorder[i]) root.right = self.buildTree(inorder[i+1:], postorder) root.left = self.buildTree(inorder[:i], postorder) return root