players are distinct. Every round, the first player in the queue (the king of the hill) fights the second. The stronger one stays at the front, and the loser goes to the back of the queue.
The tournament ends as soon as someone wins streak rounds in a row. Return that player's strength.players=[4, 9, 2, 7, 1], streak=2 → 9
9 beats 4 (one win), then beats 2 (two in a row), and the tournament is over.
players=[6, 3, 8, 5], streak=5 → 8
8 takes the hill in the second round and never loses after that, so it eventually wins 5 in a row.
players are distinctplayers=[4, 9, 2, 7, 1], streak=2
9
Run checks the first 3 tests in your browser. Submit checks all 105 tests on the server, hidden ones included.