Algorithm · Amazon · Medium
This problem is a variation of the classic Reorganize String problem. Solving that problem first is recommended if you have not already done so. Given a string s containing lowercase English letters, produce every rearrangement in which identical characters never appear next to one another. The returned array must follow these rules: Every string in the array must have no two equal characters in adjacent positions. When several valid rearrangements exist, include all of…
Checking your access…