c++ || recursion + map || beat 100%
\n# Code\n\nclass Solution {\npublic:\n    TreeNode* buildTree(vector<int>& ino, vector<int>& post) {\n    int i1 = post.size()-1;\n        return solve(i1,ino,
\n# Code\n```\nclass Solution {\npublic:\n    TreeNode* buildTree(vector<int>& ino, vector<int>& post) {\n    int i1 = post.size()-1;\n        return solve(i1,ino,post,0,ino.size()-1);\n    }\n    TreeNode* solve(int &i,vector<int> &in,vector<int> &post,int l,int r){\n        if(l>r)return NULL;\n        int x = r;\n        while(post[i] != in[x]){\n            x--;\n        }\n        i--;\n        TreeNode* root = new TreeNode(in[x]);\n        root->right = solve(i,in,post,x+1,r);\n        root->left = solve(i,in,post,l,x-1);\n        return root;\n    }\n};\n```
['C++']