HackerEarth Promotion problem solution - TheCScience