Hackerrank Binary Tree Nodes Solution