Algorithm · Google · Medium
Given the root of a binary tree, return the largest number of nodes that form a downward parent-to-child chain where every child value is exactly one more than its parent value. A chain may start at any node and must follow edges from parent to child only. The length is the number of nodes in the chain, and a single node counts as a chain of length $$1$$. Each node is represented recursively as [val, left, right], where left and right are either nested node representations…
Checking your access…