JAVA || Easy Solution || 100% Faster Code
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode() {}\n *     TreeNode(int val) { this.val = val; }\n *     TreeNode(int val, TreeNode left, TreeNode right) {\n *         this.val = val;\n *         this.left = left;\n *         this.right = right;\n *     }\n * }\n */\nclass Solution {\n    public TreeNode buildTree(int[] inorder, int[] postorder) {\n        Map<Integer, Integer> map = new HashMap<>();\n        for (int i = 0; i < inorder.length; i++) {\n                map.put(inorder[i], i);\n           \n        }\n        \n        return helper(map, postorder, 0, inorder.length - 1, 0, postorder.length - 1);\n        \n    }\n    \n    private TreeNode helper(Map<Integer, Integer> map, int[] postorder, int inLeft, int inRight, int poLeft, int poRight) {\n        if (inLeft > inRight) {\n            return null;\n        }\n        \n        TreeNode root = new TreeNode(postorder[poRight]);\n        int inMid = map.get(root.val);\n        \n        root.left = helper(map, postorder, inLeft, inMid - 1, poLeft, poLeft + inMid - inLeft - 1);\n        root.right = helper(map, postorder, inMid + 1, inRight, poRight - inRight + inMid, poRight - 1);\n        return root;\n    }\n\t\n}\n```
['Java']