You are given a row of N sweets each of which has one of N different colors. What is the minimum number of sweets you must remove so that no two sweets of one color are separated by a sweet of a different color?
For each input case, the program should the minimum number of sweets removed to satisfy the condition given in the problem.