yeonghwanjeon / coding_practice

0 stars 0 forks source link

[LeetCode]same tree(완료) #42

Open yeonghwanjeon opened 5 years ago

yeonghwanjeon commented 5 years ago

class Solution(object): def isSameTree(self, p, q): if not p or not q : return p == q else : return p.val == q.val and self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right)