HackerEarth Array Modification problem solution - TheCScience