The insight: each team has two colors that always travel together. Create a struct with home and away fields. Store all teams in an array of these structs, keeping each team's data bundled.
Use nested loops to simulate all games. The outer loop picks a host team, the inner loop picks a guest team. Skip when host equals guest (teams don't play themselves). Check if host's home color matches guest's away color.
Count conflicts as you find them. Each conflict means the guest must change uniforms. This double-loop pattern with structs appears frequently when comparing all pairs of objects.