Very Easy 3 line cpp intutive solution


#1
int Solution::isSameTree(TreeNode* A, TreeNode* B) {
        if(!A && !B)return 1;
        if(A && B && A->val==B->val && isSameTree(A->left,B->left) && isSameTree(A->right,B->right))
        return 1;
        else return 0;

}
Basic traversal logic