C++ easy to understand 0ms


  • 1
    H

    '''
    bool isSameTree(TreeNode* p, TreeNode* q) {
    if (q&&p&&p->val==q->val){ return isSameTree(p->left,q->left)&&isSameTree(p->right,q->right);}
    else if(!p&&!q) return true;
    else return false;
    }


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.