Given an array of integers `colors` where each element represents one of three distinct colors, determine the minimum number of steps to rearrange the elements into a specific sequence where the same colors are grouped together.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak