Text Decompressor
You need to decompress text. The compressed version has a number next to each symbol/letter, representing the amount of time that symbol should appear. For example, a2b3 is the compressed version of aabbb Task: Write a program that takes the compressed text as input and outputs the decompressed version. Input Format: A single string with letters/symbols, each followed by a number. Output Format: A string, representing the decompressed text. Sample Input: k2&4b1 from itertools import * a = input() b = list(a) c = [] while len(a)/2 > len(c): c.append(2) Output = [b[x - y: x] for x, y in zip( accumulate(c), c)] n = 0 z = [] while len(z) < len(Output): for i in Output: if Output.index(i) == n: z.append(i[0] * int(i[1])) n += 1 df = ("".join(i for i in z)) print(df) Above my code isn't passing the 5th case and it's locked, hence not able to check it. Plz help in correcting me.