So, my question is: Is it good enough to learn only n(log n)^2 suffix array implementation for solving problems related to suffix array in any contests? Have you seen any problem where O(n*(log n)^2) fails but O(n*(log n)) passes? If you think that one must know O(n*(log ...
There's usually a common strategy for "find *" problems - binary search: half the space can be dropped by some rules. And take care of corner cases. View Code