I am trying to solve this spoj problem related to strings and i am constantly getting time limit exceeded.here is my solution .Any help would be appreciated ! thanks :)
I am trying to solve this spoj problem related to strings and i am constantly getting time limit exceeded.here is my solution .Any help would be appreciated ! thanks :)
You should notice that taking the substrings then concatenate them is not O(1) but O(|S|), then you method should be O(|S|2)