public TreeNode buildTree(int[] preorder, int[] inorder) {
        if(preorder.length == 0 && inorder.length == 0) return null;
        TreeNode node = buildTreeRec(preorder, inorder, 0, preorder.length-1, 0, inorder.length-1);
        return node;
    }