Simple and clean Java solution with comments, recursive.
\n    public TreeNode buildTree(int[] inorder, int[] postorder) {\n        return buildTree(inorder, inorder.length-1, 0, postorder, postorder.length-1);\n    }
    \n    public TreeNode buildTree(int[] inorder, int[] postorder) {\n        return buildTree(inorder, inorder.length-1, 0, postorder, postorder.length-1);\n    }\n\n\tprivate TreeNode buildTree(int[] inorder, int inStart, int inEnd, int[] postorder,\n\t\t\tint postStart) {\n\t\tif (postStart < 0 || inStart < inEnd)\n\t\t\treturn null;\n\t\t\n\t\t//The last element in postorder is the root.\n\t\tTreeNode root = new TreeNode(postorder[postStart]);\n\t\t\n\t\t//find the index of the root from inorder. Iterating from the end.\n\t\tint rIndex = inStart;\n\t\tfor (int i = inStart; i >= inEnd; i--) {\n\t\t\tif (inorder[i] == postorder[postStart]) {\n\t\t\t\trIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//build right and left subtrees. Again, scanning from the end to find the sections.\n\t\troot.right = buildTree(inorder, inStart, rIndex + 1, postorder, postStart-1);\n\t\troot.left = buildTree(inorder, rIndex - 1, inEnd, postorder, postStart - (inStart - rIndex) -1);\n\t\treturn root;\n\t}
['Java']