input: Write a python function to determine if the characters of a specified string can be rearranged so that no two adjacent characters are the same.
  assert rearrange_characters("aab")==('aba')
  assert rearrange_characters("aabb")==('abab')
  assert rearrange_characters("abccdd")==('cdabcd')
output: def rearrange_characters(s):
      import heapq
      from collections import Counter
      
      count = Counter(s)
      max_heap = [(-value, key) for key, value in count.items()]
      heapq.heapify(max_heap)
      
      prev_char, prev_freq = '', 0
      result = []
      
      while max_heap:
          freq, char = heapq.heappop(max_heap)
          result.append(char)
          
          if prev_freq < 0:
              heapq.heappush(max_heap, (prev_freq, prev_char))
          
          prev_char = char
          prev_freq = freq + 1
      
      result_str = ''.join(result)
      
      for i in range(1, len(result_str)):
          if result_str[i] == result_str[i - 1]:
              return ""
      
      return result_str