This is a reach incase anyone is familiar with Graph Theory; specifically, Suffix Trees. I've been thinking about this problem and I haven't had luck trying to figure out a solution.

Given a suffix tree, how can you find the longest repeat in a text. Note that the repeats don't have to be adjacent to each other.

And then, how can you find the shortest string that has no repeat in the text. That is, finding the shortest string that appears in the text exactly once.