class Team
homeColor, guestColor
constructor(home, guest)
this.homeColor := home
this.guestColor := guest
function count_conflicts(teams)
conflicts := 0
n := length of teams
for i from 0 to n - 1
for j from 0 to n - 1
if i ≠ j then
if teams[i].homeColor = teams[j].guestColor then
conflicts := conflicts + 1
return conflicts
``` homeColor with teams[j].guestColor. The time complexity is $O(n^2)$ where $n$ is the number of teams.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/cpp/classes-objects/games-implementation
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████