LC: 358. Rearrange String k Distance Apart
https://leetcode.com/problems/rearrange-string-k-distance-apart/
Input: s = "aabbcc", k = 3
Output: "abcabc"
Explanation: The same letters are at least a distance of 3 from each other.Input: s = "aaabc", k = 3
Output: ""
Explanation: It is not possible to rearrange the string.Input: s = "aaadbbcc", k = 2
Output: "abacabcd"
Explanation: The same letters are at least a distance of 2 from each other.Last updated