EPAM Systems Interview Question

DSA: Rearrange a string so that no two adjacent characters are the same. Examples: "aaabbc" → valid rearrangement, "aaab" → not possible.