0549. Binary Tree Longest Consecutive Sequence II
Last updated
Last updated
**Input:** root = [1,2,3]
**Output:** 2
**Explanation:** The longest consecutive path is [1, 2] or [2, 1].**Input:** root = [2,1,3]
**Output:** 3
**Explanation:** The longest consecutive path is [1, 2, 3] or [3, 2, 1].