Problem of the day
Given a binary tree, return the longest path from leaf to root. Longest means, a path which contain maximum number of nodes from leaf to root.
Elements in level order form (separated by space)
(If any node does not have left or right child, take -1 in its place)
Output format :
Line 1 : Binary Tree 1 (separated by space)
5 6 10 2 3 -1 -1 -1 -1 -1 9 -1 -1

9
3
6
5
