Kattis dancerecital solution
In this problem, each dancer is represented by a unique uppercase letter, and each dance routine is described by a string of characters, each character representing a dancer. The key challenge is to rearrange the order of these routines to minimize the number of quick costume changes needed when dancers perform in consecutive routines.