Getting TLE which involves string

Getting TLE for a problem which requires to take input of string of size<= 10^5 and compare every character with other char for e.g ‘a’, ‘.’, ‘b’ . How can i remove this TLE

This cant be done as your algo has order O(n*n) .You have to think another algo of better complexity . BTW can u give the question link