Hacker Rank : Utopian Tree