Binary Tree Nodes Hackerrank Solution