hackerrank:add solution to Utopia Tree problem