fork(1) download
  1. import re
  2.  
  3. def srp(s):
  4. return re.search(r'(.+?)\1+', s).group(1)
  5.  
  6. print srp('dabcdbcdbcdd')
  7. print srp('cbabababac')
Success #stdin #stdout 0.03s 6680KB
stdin
Standard input is empty
stdout
bcd
ba