Added substrings solution