Two rounds.
On the first round, each person k swaps hats with person N-k+1 (so person 1 swaps with person N, person 2 swaps with person N-1, etc.) If N is odd, the person in the middle keeps the hat they have.
On the second round, person 1 already has their own hat, so they keep it, and every other person k swaps with person N-k+2 (so person 2 with person N, 3 with N-1, etc.). If N is even, then person N/2 + 1 does not swap. |