Update has_path_sum.py

This commit is contained in:
bt3gl 2023-07-30 15:52:27 -07:00 committed by GitHub
parent f6477288e1
commit 93c8e2abf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# author: bt3gl
def has_path_sum(root: Optional[TreeNode], target_sum: int) -> bool: def has_path_sum(root: Optional[TreeNode], target_sum: int) -> bool:
def transverse(node, sum_here=0): def transverse(node, sum_here=0):