input: Write a python function to compress a string by counting consecutive occurrences of characters.
  assert compress_string("aabcccccaaa") == "a2b1c5a3"
  assert compress_string("abcd") == "a1b1c1d1"
  assert compress_string("aaabbbccc") == "a3b3c3"
  assert compress_string("") == ""
  assert compress_string("a") == "a1"
output: def compress_string(s):
      if not s:
          return ""
      
      compressed = []
      count = 1
      
      for i in range(1, len(s)):
          if s[i] == s[i-1]:
              count += 1
          else:
              compressed.append(s[i-1] + str(count))
              count = 1
      
      compressed.append(s[-1] + str(count))
      
      return ''.join(compressed)