Given the root of a binary tree, return the length of the longest consecutive sequence path in the tree.
A consecutive sequence path is defined as a path where the values of adjacent nodes in the sequence differ by exactly
The path can move along parent and child connections in any valid route (such as from a child to a parent to another child), but it cannot split into more than two branches at any node.
Constraints:
The number of nodes in the tree is in the range
Node.val
Given the root of a binary tree, return the length of the longest consecutive sequence path in the tree.
A consecutive sequence path is defined as a path where the values of adjacent nodes in the sequence differ by exactly
The path can move along parent and child connections in any valid route (such as from a child to a parent to another child), but it cannot split into more than two branches at any node.
Constraints:
The number of nodes in the tree is in the range
Node.val