leetle

Daily challenge for 2026-01-14

379. Find Root in Binary Tree

Given the root of a binary tree, determine if a specific target node value exists within the tree. The tree nodes are defined by a val attribute for the node's value, and left and right attributes for child pointers. Return true if the target is found, and false otherwise. Assume the tree structure is provided as an object/dictionary representation where null/None indicates no child.

Example Tree Structure: { val: 1, left: { val: 2, left: null, right: null }, right: { val: 3, left: null, right: null } }

Run this challenge interactively in Python or JavaScript when the app loads.