(self, p: Optional[TreeNode], q: Optional[TreeNode])
| 14 | # self.right = right |
| 15 | class Solution: |
| 16 | def isSameTree(self, p: Optional[TreeNode], q: Optional[TreeNode]) -> bool: |
| 17 | if not p and not q: #return true if both nodes are Null |
| 18 | return True |
| 19 | if not p or not q or p.val != q.val: #return false if any of the root is Null or value of both roots is not equal |
| 20 | return False |
| 21 | |
| 22 | return self.isSameTree(p.left , q.left) and self.isSameTree(p.right, q.right) |
| 23 |
nothing calls this directly
no outgoing calls
no test coverage detected