input: Write a Python function to determine if the characters in a specified string can be rearranged such that no two adjacent characters are the same.
  
  assert rearrange_chars("aab") == ('aba')
  assert rearrange_chars("aabb") == ('abab')
  assert rearrange_chars("abccdd") == ('cdabcd')
output: def rearrange_chars(s):
      from collections import Counter
      from heapq import heappop, heappush, heapify
      counter = Counter(s)
      maxHeap = [(-cnt, char) for char, cnt in counter.items()]
      heapify(maxHeap)
      prev_count, prev_char = 0, ''
      result = []
  
      while maxHeap:
          count, char = heappop(maxHeap)
          result.append(char)
          if prev_count < 0:
              heappush(maxHeap, (prev_count, prev_char))
          prev_count, prev_char = count + 1, char
  
      return ''.join(result) if len(result) == len(s) else ''