Category: BFS
Given a binary tree root, return the leftmost node’s value on each level of the tree. Constraints n ≤ 100,000 where n is the number of nodes in root …
Given a binary tree root, return whether for every node in the tree other than leaves, its value is equal to the sum of its left child’s value and …
Given the root of a binary tree and a node u in the tree, return the nearest node on the same level that is to the right of u, …
Return all non-negative integers of length N such that the absolute difference between every two consecutive digits is K. Note that every number in the answer must not have …
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 …