Write a function called compress(s) that takes a binary string s of length less than or equal
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function called compress(s) that takes a binary string s of length less than or equal to 64 as input and returns another binary string as output. The output binary string should be a run-length encoding of the input string. You may need a helper function or two — you may name these whatever you like.
Write a function called uncompress(c) that “inverts” or “undoes” the compressing in your compress function. That is, uncompress(compress(s)) should give back s.
Related Book For
Posted Date: