HackerEarth Changes in a string problem solution - TheCScience