A sequence of characters is given; rearrange them so that any two consecutive characters cannot be the same.
Implement rearrange_chars(s), returning a rearranged string with no equal adjacent characters. Return "" if no valid rearrangement exists. Any valid arrangement is acceptable.
s is a string. Return a string containing exactly the same characters as s, or "" when rearrangement is impossible.
def rearrange_chars(s):