Compress string from AAABBCC to A3B2C2.
Return a compressed string by replacing each maximal consecutive run with the character followed by its count. Preserve the order of runs, include counts of one, and return an empty string for empty input.
Function: def compress_string(s):
Input: A string s.
Output: A string containing each run-length encoded character and count.
Examples: AAABBCC returns A3B2C2; ABBA returns A1B2A1.
Constraints: 0 <= len(s) <= 1000; characters may be any printable ASCII character.
def compress_string(s):