Number of games = 15
G(n) = (n2 - n)/2
By the given condition

(n2 - n)/2 = 15
n2 – n = 30 ⇒ n2 – n – 30 = 0
(n – 6) (n + 5) = 0
n – 6 = 0 or n + 5 = 0
[Note: – 5 is neglected because number of team is not negative]
n = 6 or n = -5
∴ Number of teams = 6