Solved Utopian Tree Hackerrank