solulubeta
Sign in
Story Problems / Priority queue
04.03 · Problem

Seat Guests With No Twin Neighbours

Medium Max-heap of counts (alternate the two most frequent) Pro

This problem is part of solulu Pro

Guests wear coloured badges given as a string of letters. Rearrange them in a row so that no two adjacent guests have the same badge colour. Return any valid arrangement, or an empty string if it is impossible.

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 48 of 94 · updated 2026-10-12