767. Reorganize String
Problem Statement
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:
Example 2:
Constraints:
1 <= s.length <= 500
s
consists of lowercase English letters.
Intuition
Links
Video Links
Approach 1:
Approach 2:
Approach 3:
Approach 4:
Similar Problems
Previous5. Longest Palindromic SubstringNext2840. Check if Strings Can be Made Equal With Operations II
Last updated