Your question is Run-Length String Compression Choice. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
At Dropbox, you are asked to implement a lightweight string compressor using run-length encoding. Given a string s, compress consecutive repeated characters so that each group becomes the character followed by its count, then return whichever is shorter: the compressed string or the original string.
scharacter + countdef compress_string(s):