C++ | Easy and Clean code | 15ms | Faster than 88.23%
\nclass Solution {\npublic:\n    TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {\n        if(inorder.size()!=postorder.size())\n            
```\nclass Solution {\npublic:\n    TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {\n        if(inorder.size()!=postorder.size())\n            return NULL;\n        map<int,int> hm;\n        for(int i=0;i<inorder.size();i++)\n            hm[inorder[i]]=i;\n        TreeNode* root=solve(inorder,0,inorder.size()-1,postorder,0,postorder.size()-1,hm);\n        return root;\n    }\n    TreeNode* solve(vector<int> &inorder,int is,int ie,vector<int> &postorder,int ps,int pe,map<int,int> &hm){\n        if(ps>pe || is>ie)\n            return NULL;\n        TreeNode* root=new TreeNode(postorder[pe]);\n        int inRoot=hm[postorder[pe]];\n        int numsleft=inRoot-is;\n        root->left=solve(inorder,is,inRoot-1,postorder,ps,ps+numsleft-1,hm);\n        root->right=solve(inorder,inRoot+1,ie,postorder,ps+numsleft,pe-1,hm);\n        return root;\n    }\n};\n```
['Recursion', 'C', 'Binary Tree', 'C++']