LeetCode
Binary Tree Longest Consecutive Sequence
Click
here
for an explanation.