The idea is:

Find root: root must be last postorder element

Search for root in inorder array. This point is the middle of two subtrees.
Left subtree inorder elements are to the left of 'middle'. Right subtree elements are to the right of 'middle'
For postorder elements: starting from 0 count to inorder left size. Then inorder right size. Last element (previous root) can be eliminated.
public class Solution {
public TreeNode buildTree(int[] inorder, int[] postorder) {
if (inorder.length == 0) {
return null;
}
if (inorder.length == 1) {
return new TreeNode(inorder[0]);
}
TreeNode root = findRoot(inorder, postorder);
int middle = findMiddle(inorder, root);
int[] inorderLeft = Arrays.copyOfRange(inorder, 0, middle);
int[] inorderRight = Arrays.copyOfRange(inorder, middle+1, inorder.length);
int[] postOrderLeft = Arrays.copyOfRange(postorder, 0, inorderLeft.length);
int[] postOrderRight = Arrays.copyOfRange(postorder, inorderLeft.length, inorderLeft.length+inorderRight.length);
root.left = buildTree(inorderLeft, postOrderLeft);
root.right = buildTree(inorderRight, postOrderRight);
return root;
}
private TreeNode findRoot(int[] inorder, int [] postorder) {
return new TreeNode(postorder[postorder.length1]);
}
private int findMiddle(int[] inorder, TreeNode node) {
int middle = 1;
for (int i=0; middle==1;i++) {
if (inorder[i] == node.val) {
middle = i;
}
}
return middle;
}
}