Given the root of a binary tree, find the length of the longest path where each node is consecutive to its parent (i.e., node value is parent value + 1). Implement the node and tree classes from…
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.