Hackerrank: utopian_tree
https://www.hackerrank.com/challenges/utopian-tree