O(n) c++ recursive solution - 23ms with comments
TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) {\n            unordered_map<int, int> inorder_map;\n            // we need a map to look up t
    TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) {\n            unordered_map<int, int> inorder_map;\n            // we need a map to look up the position of root in inorder, so\n            // that we can divide the tree into separate subtrees,\n            // reduces the complexity from n^2 to n assuming good hashing by unodered_map\n            for (int i = 0; i < inorder.size(); ++i) {\n                inorder_map[inorder[i]] = i;\n            }\n            return buildTreeHelper(postorder, 0, inorder.size()-1, 0, postorder.size()-1, inorder_map);\n        }\n        \n        TreeNode* buildTreeHelper(vector<int>& post, int is, int ie, int ps, int pe, unordered_map<int, int>& inorder_map) {\n            \n            if (is > ie || ps > pe) {\n                return NULL;\n            }\n            int root_val = post[pe];\n            TreeNode* root = new TreeNode(root_val);\n            int i = inorder_map.find(root_val)->second;\n            // number of nodes in left subtree\n            int l = i-is;\n            root->left = buildTreeHelper(post, is, is+l-1, ps, ps+l-1, inorder_map);\n            root->right = buildTreeHelper(post, is+l+1, ie, ps+l, pe-1, inorder_map);\n            \n            return root;\n        }
['Binary Tree', 'C++']