I have been tasked with identifying an efficient algorithm [O(n*log(n))] that, given a set of k Strings S = {s-1, s-2, s-3, ..., s-k}, will identify the longest substring T for each pair of strings (s-i, s-j), such that T is a suffix of s-i and a prefix of s-j, as well as the longest substring T for each pair of strings (s-j, s-i). n represents the added lengths of all k strings (n = |s-1| + |s-2| + |s-3| + ... + |s-k|).
Any thoughts? A link to a solution would be fine as well. Thanks in advance!

Siand prefix ofSjis the whole ofSi + Sj. Are we talking about longest common/Uncommon substring? - thebenmannin O(log n)? Did you meank? The total number of characters in all the strings? Anyway, logarithmic time seems incredibly optimistic for an algorithm which produces k² result strings. Did you maybe mean O(n log n)? Please clarify. - rici