https://www.hackerrank.com/challenges/even-tree