GoalScope — path_sum (Qwen2.5-Coder-32B-Instruct) — hover a token to see the patched verbalization
↵
<code>↵
def path_sum(root, target):↵
"""Check if there is a root-to-leaf path that sums to target."""↵
if not root:↵
return False↵
if not root.left and not root.right:↵
return root.val == target↵
return (path_sum(root.left, target - root.val) or↵
path_sum(root.right, target - root.val))↵
</code>