from zlib import decompress
from base64 import b64decode


def decompress_string(string: str) -> str:
    """
    Decompress a UTF-8 string compressed by compress_string

    :param string: base64-encoded string to be decompressed
    :return: original string
    """

    # b64 string -> b64 byte array -> compressed byte array
    b64_bytes = b64decode(string.encode('utf-8'))
    # compressed byte array -> byte array -> original string
    string_bytes = decompress(b64_bytes)
    string_decompressed = string_bytes.decode('utf-8')
    return string_decompressed