Sony Interview Question

dsa question was about traversing the tree to find the leaf node