HackerEarth Operations on a tree problem solution - TheCScience