HackerEarth Hell of a Day solved