Utopian Tree

Solved another porblem on HackerRank and sharing it's code.