MCPcopy Create free account
hub / github.com/Sugapriyan-P-K/blind75 / isSameTree

Method isSameTree

Trees/62sameTree/sameTree.py:8–13  ·  view source on GitHub ↗
(self, p: TreeNode, q: TreeNode)

Source from the content-addressed store, hash-verified

6
7class Solution:
8 def isSameTree(self, p: TreeNode, q: TreeNode) -> bool:
9 if not p and not q:
10 return True
11 if not p or not q or p.val != q.val:
12 return False
13 return (self.isSameTree(p.left, q.left) and self.isSameTree(p.right, q.right))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected