Watch 10 video solutions for Reorganize String, a medium level problem involving Hash Table, String, Greedy. This walkthrough by Kevin Naughton Jr. has 78,634 views views. Want to try solving it yourself? Practice on FleetCode or read the detailed text solution.
Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.
Return any possible rearrangement of s or return "" if not possible.
Example 1:
Input: s = "aab" Output: "aba"
Example 2:
Input: s = "aaab" Output: ""
Constraints:
1 <= s.length <= 500s consists of lowercase English letters.