In “Find the Longest Repeat in a String”1, we encountered the Longest Repeat Problem, which could be solved using a suffix-tree.
The second additional exercise that we will consider is below.
Implement the longest_shared_substring method which takes 2 strings.
The function should return a longest substring of the given strings that occurs in both of them.
>>> longest_shared_substring('TTGGGTCCGGACCCGCCGCTGCGCCGCTGCACCCGCTGGACTAT', 'CAGGAGGTCTCTCGGCCGCTGCGCCGCTGCTCGGAGTTAATTG') 'CGCCGCTGC'