You have teams, each with a home uniform color and away uniform color. Count how many games have a home team's uniform matching the away team's uniform (causing confusion).
This problem teaches polymorphism through a uniform-checking interface. You'll define a base class with a virtual method for getting colors, then different team types can override it.
The comparison code works with any team type through the base interface. Each team plays every other team twice: once at home, once away. When team hosts team , compare team 's home color with team 's away color.
Count all such matches across all game pairs.