#binarytrees
Read more stories on Hashnode
Articles with this tag
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # ...
class Solution: def evaluateTree(self, root: Optional[TreeNode]) -> bool: def travel(node): if node: ...