Java Solution
java\n\n/**\n * Definition for a binary tree node.\n * public class TreeNode {\n *     int val;\n *     TreeNode left;\n *     TreeNode right;\n *     TreeNode(
java\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        if(postorder.length == 0)\n            return null;\n        if(postorder.length == 1)\n            return new TreeNode(postorder[0]);\n        return helper(postorder.length-1, 0, inorder.length-1, postorder, inorder);\n    }\n    public TreeNode helper( int postend, int instart, int inend, int[] postorder, int[] inorder) {\n        if(postend<0 || instart>inend)\n            return null;\n        TreeNode node = new TreeNode(postorder[postend]);\n        int index=0;\n        for(int i=instart;i<=inend;i++) {\n            \n            if(inorder[i] == node.val) {\n                index=i;\n                break;\n            }\n        }\n        node.left = helper(postend - 1 - inend + index, instart, index-1, postorder, inorder);\n        node.right = helper(postend-1, index+1, inend, postorder, inorder);\n        return node;\n    }\n}\n```
[]