0

I need to write two functions called compress(S) and decompress(S) that take a binary string S of length less than or equal to 64 as input and return another binary string as output. The output binary string should be a run-length encoding of the input string.

COMPRESSED_BLOCK_SIZE = 5

MAX_RUN_LENGTH = 2 ** COMPRESSED_BLOCK_SIZE - 1

>>>compress( 64*'0' )
'1111100000111110000000010'

>>>uncompress('1111100000111110000000010')
'64*0'
2
  • What is your question? Commented Mar 28, 2022 at 7:55
  • (Hint: questions end with a question mark.) Commented Mar 28, 2022 at 19:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.