0298. Binary Tree Longest Consecutive Sequence
Last updated
Last updated
**Input:** root = [1,null,3,2,4,null,null,null,5]
**Output:** 3
**Explanation:** Longest consecutive sequence path is 3-4-5, so return 3.**Input:** root = [2,null,3,2,null,1]
**Output:** 2
**Explanation:** Longest consecutive sequence path is 2-3, not 3-2-1, so return 2.