HackerEarth Cube Change problem solution - TheCScience