Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
simple recursion (functional) solution in Clear category for Tree Walker by juestr
def tree_walker(tree, target):
return tree == target or sum(tree_walker(child, target) for child in
(tree if isinstance(tree, list) else tree.values() if isinstance(tree, dict) else []))
Jan. 16, 2020
Comments: