Simple binary tree DFS recursion code is stopping early and not walking full tree
I’m trying to walk down a binary tree, look for a target TreeNode, and then return that Node when I find it. My code is: # Definition for a binary tree node. # class TreeNode: # def __init__(self, …