Knockout tournament by rank, then build the bracket
Players are listed by rank, where a smaller number is a better player. Neighbours play each other (index 0 against 1, 2 against 3, and so on) and the better rank advances, round after round, until one player is left.
- Simulate the tournament and output each round's survivors. Handle an odd number of players.
- Go the other way: build a starting order in which, of any two players, the better-ranked one is knocked out later.
One report ended with questions on storing and querying match records in a database.
No answer yet. Write the first one; the best answer gets endorsed.
