input: Write a python function to compress a string using counts of repeated characters.
  assert compress_string("aaabbccddaaa") == "a3b2c2d2a3"
  assert compress_string("abcd") == "a1b1c1d1"
  assert compress_string("aabcccccaaa") == "a2b1c5a3"
output: def compress_string(s):
      if not s:
          return ""
      
      compressed = []
      count = 1
      prev_char = s[0]
  
      for char in s[1:]:
          if char == prev_char:
              count += 1
          else:
              compressed.append(prev_char + str(count))
              prev_char = char
              count = 1
  
      compressed.append(prev_char + str(count))
      return ''.join(compressed)