public TreeNode build(int[] postorder, int begin, int end, HashMap<Integer, Integer> hashMap, int hashStart, int hashEnd) {
        if (begin > end)
            return null;
        int val = postorder[end];
        int index = hashMap.get(val);
        TreeNode root = new TreeNode(val);
        root.right = build(postorder, end - (hashEnd - index), end - 1, hashMap, index + 1, hashEnd);
        root.left = build(postorder, begin, begin + index - hashStart - 1, hashMap, hashStart, index - 1);
        return root;
    }