Leetcode 767. Reorganize String
Rearrange the characters of a string so that no two adjacent characters are the same, returning any valid permutation or "" if none exists. Key insight: feasibility depends on character frequencies (no letter can occur more than (n+1)/2 times), and it's typically solved with a greedy/priority-queue strategy to place the most frequent remaining letters.
Asked at:

Amazon
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Mid January, 2025

Amazon
Mid-level
Late August, 2024

Amazon
Intern
Reorganize String (LeetCode 767)
Your account is free and you can post anonymously if you choose.