We are going to hold a meeting where everybody will speak in clockwise direction around a table. There are n people with n spots. Each person has a position preference (e.g. some want to go first, some last, etc). Everyone is seated randomly and cannot move from their position. How shall we compute the best starting position on the table to satisfy the most people?
I have an O(n^2) solution: See how many people would be satisfied having assumed each of the positions 1..n as start positions; then return the position that gave the maximum value.