input: Write a python function to compress a string by counting the occurrences of each character.
  assert compress_string("aabbcc") == "a2b2c2"
  assert compress_string("aaabbbccc") == "a3b3c3"
  assert compress_string("abcd") == "a1b1c1d1"
  assert compress_string("aabbccddeeff") == "a2b2c2d2e2f2"
output: def compress_string(s):
      if not s:
          return ""
      compressed = []
      current_char = s[0]
      count = 1
      for char in s[1:]:
          if char == current_char:
              count += 1
          else:
              compressed.append(current_char + str(count))
              current_char = char
              count = 1
      compressed.append(current_char + str(count))
      return ''.join(compressed)