CodeChef JulyChallenge2014 competition CountSubstrings