Last active
April 3, 2019 20:45
-
-
Save adw0rd/d512ce1e684d52b9b9f33943c60ea0e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def main(text): | |
n, s, result = '', '', [] | |
for i in text: | |
if i.isdigit(): | |
n += i | |
else: | |
if n: | |
result.append(s * int(n)) | |
s = i | |
n = '' | |
result.append(s * int(n)) | |
return ''.join(result) | |
if __name__ == '__main__': | |
print(main(sys.argv[1])) |
Author
adw0rd
commented
Apr 3, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment