Bad test cases. Wrong code submitted correctly


#1

My Cose is :-

int sol(TreeNode* A,TreeNode* B){
if(A==NULL && B==NULL) return(true);
if(A==NULL) return(false);
if(B==NULL) return(false);
if(sol(A->left,B->right))
if(A->val!=B->val) return(false);
else return(true);
else return(false);
}
int Solution::isSymmetric(TreeNode* A) {
if(A==NULL) return(true);
return(sol(A,A));
}

It has been submitted correctly, but it is wrong code it fails to give output for-
15 1 2 2 3 5 4 3 -1 -1 -1 -1 -1 -1 -1 -1
answer should be 0, but my code shows 1