You are given an integer n, representing the initial number of teams participating in a tournament.
The tournament proceeds according to the following rules:
If the current count of teams is even, each team is paired with another team. A total of
If the current count of teams is odd, one team randomly advances, and the remaining teams are paired. A total of
Return the total count of matches played throughout the tournament until a single winner is determined.
Constraints:
You are given an integer n, representing the initial number of teams participating in a tournament.
The tournament proceeds according to the following rules:
If the current count of teams is even, each team is paired with another team. A total of
If the current count of teams is odd, one team randomly advances, and the remaining teams are paired. A total of
Return the total count of matches played throughout the tournament until a single winner is determined.
Constraints: