Tag: recursive dfs
Given a binary tree root, return the largest absolute difference between any node and its descendants. For example, given the following tree: 0 / \ 4 2 / \ …
In a binary tree, a lonely node is a node that is the only child of its parent node. The root of the tree is not lonely because it …
Given the root of a binary tree, each node has a value from 0 to 25 representing the letters ‘a’ to ‘z’: a value of 0 represents ‘a’, a …
Given a binary tree, return the sum of values of its deepest leaves. Example 1: Input: root = Output: 15 Constraints: The number of nodes in the tree is …
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->2->3 which represents the number 123. Find …