Let us construct a Binary Tree 4 / \ 4 4 / \ \ 4 9 5
INDENT root = None NEW_LINE root = newNode ( 4 ) NEW_LINE root . left = newNode ( 4 ) NEW_LINE root . right = newNode ( 4 ) NEW_LINE root . left . left = newNode ( 4 ) NEW_LINE root . left . right = newNode ( 9 ) NEW_LINE root . right . right = newNode ( 5 ) NEW_LINE print ( longestSameValuePath ( root ) ) NEW_LINE DEDENT