Your question is Compress Consecutive Characters. 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.
Given a string s, return a new string using run-length compression. Replace each group of consecutive repeated characters with the character followed by its count, but only when the count is greater than 1. The function should return the compressed string as a string.
def compress_string(s):