[c++] 0ms runtime, video explanation, simple solution
video will be uploaded at 2PM IST \nChannel link>>>\nhttps://www.youtube.com/channel/UCkcMtAWv5PO1p6eal7TXoEw/\n\n/**\n * Definition for a binary tree node.\n *
video will be uploaded at 2PM IST \nChannel link>>>\nhttps://www.youtube.com/channel/UCkcMtAWv5PO1p6eal7TXoEw/\n```\n/**\n * Definition for a binary tree node.\n * struct TreeNode {\n *     int val;\n *     TreeNode *left;\n *     TreeNode *right;\n *     TreeNode(int x) : val(x), left(NULL), right(NULL) {}\n * };\n */\nclass Solution {\npublic:\n    unordered_map<int,int> m;\n    \n    TreeNode* buildTree(vector<int>& inorder, vector<int>& postorder) {\n        for(int i=0;i<inorder.size();i++)\n            m[inorder[i]]=i;\n        int rootIndex=postorder.size()-1;\n        return buildUtil(inorder,postorder,0,inorder.size()-1,rootIndex);\n    }\n    \n    TreeNode* buildUtil(vector<int>& inorder, vector<int>& postorder, int inleft, int inright, int &rootIndex)\n    {\n        if(inleft > inright)\n            return NULL;\n        \n        int val = postorder[rootIndex];\n        TreeNode *node = new TreeNode(val);\n        rootIndex--;\n        \n        if(inleft==inright)\n            return node;\n        int pivot=m[val];\n        \n        node->right = buildUtil(inorder, postorder, pivot + 1, inright, rootIndex); \n        node->left = buildUtil(inorder, postorder, inleft, pivot - 1, rootIndex); \n  \n        return node; \n    }\n};\n```
[]