Python O(n) by definition. 80%+ [ w/ Comment ]
Python O(n) by definition.\n\n---\n\n\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, x):\n#         self.val = x\n#         
Python O(n) by definition.\n\n---\n\n```\n# Definition for a binary tree node.\n# class TreeNode:\n#     def __init__(self, x):\n#         self.val = x\n#         self.left = None\n#         self.right = None\n\nclass Solution:\n    def buildTree(self, inorder: List[int], postorder: List[int]) -> TreeNode:\n        \n        ## dictionary\n        # key: number\n        # value: index in inorder array\n        val_index_dict = { num:idx for idx, num in enumerate(inorder) }\n        \n        def helper( left, right):\n            \n            if left > right:\n                # Base case:\n                # return empty node as leaf node\'s child\n                return None\n            \n            else:\n                \n                # Recall:\n                # definition of postorder traversal: Left, Right, Center\n                # rebuild with reversed direction ( from right to left )\n                root = TreeNode( postorder.pop() )\n                \n                mid = val_index_dict[ root.val ]\n                \n                root.right = helper( mid+1, right)\n                root.left = helper( left, mid-1 )\n                return root\n        # ----------------------------------------------------\n        \n        ## Top-down rebuild binary tree with definition\n        return helper( left = 0, right = len(inorder)-1 )\n```\n\n---\n\nReference:\n\n[1] [Leetcode training session: Binary Tree Traversal](https://leetcode.com/explore/learn/card/data-structure-tree/134/traverse-a-tree/992/)
['Depth-First Search', 'Recursion', 'Python', 'Python3']