🏆C++ || Striver's approach
Code\n\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : 
# Code\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode() : val(0), left(nullptr), right(nullptr) {}\n *     TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}\n *     TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}\n * };\n */\nclass Solution {\npublic:\n    map<int,int>m;\n    TreeNode* buildTree(vector<int>& in, vector<int>& post) {\n        for(int i=0;i<in.size();i++)m[in[i]]=i;\n        TreeNode* root = build(in,0,in.size()-1,post,0,post.size()-1);\n        return root;\n    }\n    TreeNode* build(vector<int>&in, int inS,int inE,vector<int>&post,int postS,int postE){\n        if(inS>inE || postS>postE)return NULL;\n        TreeNode* root = new TreeNode(post[postE]);\n        int index = m[post[postE]];\n        int len = inE - index;   \n        root->right = build(in,index+1,inE,post,postE-len,postE-1);\n        root->left = build(in,inS,index-1,post,postS,postE-len-1);\n        return root;\n    }\n};\n```\n![upvote (3).jpg](https://assets.leetcode.com/users/images/4b3e6582-96f7-459e-81c8-7e165085b188_1687249951.4209003.jpeg)\n
['Hash Table', 'Divide and Conquer', 'Tree', 'Binary Tree', 'C++']