Submission does not work and test case works


#1

I submit my code, i get a wrong answer with a case, I copy the input for that case, I try it with custom test and I get the correct answer.


#2

Here is a simple C++ code that works.


int Solution::isSameTree(TreeNode* A, TreeNode* B) {
    
    if(A==NULL && B==NULL)
        return 1;
   
    if(A==NULL || B==NULL)
        return 0;

    return isSameTree(A->left, B->left) && isSameTree(A->right, B->right) && A->val==B->val;
 
}


#3

Maybe since you return False or True instead 0 and 1 in the recursive call