Skip to content

Files

longest-consecutive-branch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Mar 13, 2023
Mar 13, 2023

Given a binary tree, write a function to find the length of the longest consecutive branch in increasing order.

Sample Input

tree =    0
       /     \
      1       2
    /   \   /   \
   1     2 1     3   
        /          \
       3            4

Sample Output

4