There is a tournament with n players numbered from n standing in a single row in increasing order of their numbers.
The tournament consists of multiple rounds. In each round:
Players compete in pairs based on their positions in the row. The
If the number of players
The winners of each match, along with any player who advanced directly, move on to the next round while preserving their relative order.
Two specific players, firstPlayer and secondPlayer, are the best players in the tournament. Each of them is guaranteed to win every match against any opponent other than each other. When firstPlayer and secondPlayer compete against each other, the tournament ends.
Return an array of two integers representing the earliest round number and the latest round number in which firstPlayer and secondPlayer can face each other. Round numbers start at
Constraints:
n
firstPlayer secondPlayer n
There is a tournament with n players numbered from n standing in a single row in increasing order of their numbers.
The tournament consists of multiple rounds. In each round:
Players compete in pairs based on their positions in the row. The
If the number of players
The winners of each match, along with any player who advanced directly, move on to the next round while preserving their relative order.
Two specific players, firstPlayer and secondPlayer, are the best players in the tournament. Each of them is guaranteed to win every match against any opponent other than each other. When firstPlayer and secondPlayer compete against each other, the tournament ends.
Return an array of two integers representing the earliest round number and the latest round number in which firstPlayer and secondPlayer can face each other. Round numbers start at
Constraints:
n
firstPlayer secondPlayer n