Skip to content

Instantly share code, notes, and snippets.

@oreillyross
Last active October 6, 2022 10:26
Show Gist options
  • Save oreillyross/1b33d2d3409207bd5725851474d62ef6 to your computer and use it in GitHub Desktop.
Save oreillyross/1b33d2d3409207bd5725851474d62ef6 to your computer and use it in GitHub Desktop.
uncompress solution in python
def uncompress(s):
res = []
i = 0
for j in range(len(s)):
if s[j].isdigit():
continue;
times = int(s[i:j])
res.append(s[j] * times)
i = j + 1
return ''.join(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment