int res=0;
public intminCameraCover(TreeNode root){//0无覆盖,2有覆盖,1有摄像头if(backTrack(root)==0)res++;return res;}
public intbackTrack(TreeNode root){if(root==null)return2;int left=backTrack(root.left);int right=backTrack(root.right);if(left==2&&right==2)return0;if(left==0||right==0){
res++;return1;}return2;}