4 ms·
It's even easier than that... return players - 1. The trick is knowing in any single elimination tournament in order for there to be one winner there must be n
by 0x445442 7y ago
It's even easier than that... return players - 1. The trick is knowing in any single elimination tournament in order for there to be one winner there must be n - 1 losers.
edit: Also, I'm not sure your solution works for 13 players.
- sirsar 7y agoI wrote that it was `n-1` in my comment. Doesn't seem like much of a trick to me.