I am getting TLE for this problem: http://www.codechef.com/problems/ANUSAR/
Don't know why, with my understanding my solution is O(nlogn). But still TLE.
I have used the suffix array implementation in other problems, and its ok I guess.
My solution: http://www.codechef.com/viewsolution/4149982
Can anyone help me. Thanks in advance.