CodeChef July Challenge, Count Substrings AC.