HackerEarth The smallest string problem solution - TheCScience