<s> __author__ = "<STR_LIT>" <EOL> def longest_common_substring ( s1 , s2 ) : <EOL> p1 = <NUM_LIT:0> <EOL> aux , lcp = '<STR_LIT>' , '<STR_LIT>' <EOL> string1 = max ( s1 , s2 ) <EOL> string2 = min ( s1 , s2 ) <EOL> while p1 < len ( string1 ) : <EOL> p2 = <NUM_LIT:0> <EOL> while p2 < len ( string2 ) and p1 + p2 < len ( string1 ) : <EOL> if string1 [ p1 + p2 ] == string2 [ p2 ] : <EOL> aux += string1 [ p1 + p2 ] <EOL> else : <EOL> if len ( lcp ) < len ( aux ) : <EOL> lcp = aux <EOL> aux = '<STR_LIT>' <EOL> p2 += <NUM_LIT:1> <EOL> p1 += <NUM_LIT:1> <EOL> return lcp <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> str1 = '<STR_LIT>' <EOL> str2 = '<STR_LIT>' <EOL> result = '<STR_LIT>' <EOL> assert ( longest_common_substring ( str1 , str2 ) == result ) </s>
