Rearrange a string so no two adjacent characters are the same. Return "" if impossible.
Example: "aab" becomes "aba". "aaab" is impossible. The core idea: if any character appears more than times, it is impossible. Tricky: you must alternate characters without repeating.
If the most frequent character has count and total length is , you need at least other characters to separate them. The threshold comes from the pigeonhole principle.