Skip to content

Instantly share code, notes, and snippets.

@nsmaciej
Created April 24, 2014 23:55
Show Gist options
  • Save nsmaciej/11273558 to your computer and use it in GitHub Desktop.
Save nsmaciej/11273558 to your computer and use it in GitHub Desktop.
Text Decompression - Call To Code - The golfed solution
import re;t=input();m=1
while m:
m=re.search('\((\d+)(\w+)\)',t)
if m:t=t[:m.start()]+int(m.group(1))*m.group(2)+t[m.end():]
print(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment