fork download
  1. import re
  2.  
  3. for s in [ "2121212121", "1188511885", "38593859" ]:
  4. print(re.sub(r'(.+?)\1+', r'\1', s))
Success #stdin #stdout 0.02s 7228KB
stdin
Standard input is empty
stdout
21
185185
3859