HackerEarth Operations on an Array problem solution - TheCScience