input: Write a function to check if a given string can be rearranged into a sequence where each character appears exactly twice by swapping adjacent characters any number of times. If it is possible return True else return False. If the given string is empty then return True.
  
  assert can_rearrange_duplicate("aabb") == True
  assert can_rearrange_duplicate("ab") == False
  assert can_rearrange_duplicate("aaabb") == False
  assert can_rearrange_duplicate("abcabcabc") == False
  assert can_rearrange_duplicate("") == True
output: def can_rearrange_duplicate(s):
      from collections import Counter
      count = Counter(s)
      for char, freq in count.items():
          if freq % 2 != 0:
              return False
      return True