[Algorithm] 28 week(7.25 ~ 7.31) 3/3

Dev_min·2022년 7월 30일
0

algorithm

목록 보기
89/157

100. Same Tree

var isSameTree = function(p, q) {
    if (!p && !q) return true;
    
    if (!p || !q) return false;
    
    return p.val === q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right)    
};
profile
TIL record

0개의 댓글