Let's say we have a string $s$. We define a unique substring in $s$ as a substring that occurs only once in $s$. How can we efficiently find such a substring with the smallest length in $s$?The most obvious solution is in $O(n^3)$ by checking every substring. What if we can preprocess the string? 
Efficiently find smallest unique substring
algorithms;data structures;regular expressions;strings;pattern recognition