I have a string s and I want to search for the substring of length X that occurs most often in s. Overlapping substrings are allowed.
For example, if s=\"aoaoa\" and X=3
There's no way to do this in O(n).
Feel free to downvote me if you can prove me wrong on this one, but I've got nothing.