plaintext
struct Team int home, away function countConflicts(n, teams[])
conflicts := 0
for i from 0 to n - 1
for j from 0 to n - 1
if i != j and teams[i].home == teams[j].away then
conflicts := conflicts + 1
return conflicts
You iterate through all possible host-guest pairs, checking for color matches.