March 18, 2014, 8:26 p.m. by Rosalind Team
In “Find the Longest Repeat in a String” and “Find the Longest Substring Shared by Two Strings”, we encountered two problems that could be solved using a suffix tree. A third such problem is shown below.
Find the shortest substring of one string that does not appear in another string.
Given: Strings Text1 and Text2.
Return: The shortest substring of Text1 that does not appear in Text2. (Multiple solutions may exist, in which case you may return any one.)
CCAAGCTGCTAGAGG CATGCTGGGCTGGCT
AA