Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def reverseRLE(s):
- #@param s: str
- #@return str
- new_str = ''
- jmp = 1
- lung = len(s)
- k = 1
- for i in range(lung):
- if s[i] != ' ':
- if not s[i].isdigit():
- new_str+=s[i]
- else:
- while s[i+k] == ' ' and i+k<lung:
- jmp+=1
- k+=1
- new_str+=(int(s[i])-1)*s[i+jmp]
- jmp = 1
- k = 1
- return new_str
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement