public int rob(TreeNode root) {
        if (root == null) {
            return 0;
        }
        HashMap<TreeNode,int[]> aux=new HashMap<TreeNode, int[]>();
        postOrderTraversal(root,aux);
        return Math.max(aux.get(root)[0],aux.get(root)[1]);
    }