Tournament Byes
Easy · rating 1000 · Math
A single-elimination bracket needs a power-of-two number of entrants. Read n players and print how many byes (free passes) round one must hand out to reach the next power of two — 0 if n is already a power of two.
Constraints: 1 ≤ n ≤ 109
Related problems
- Account Balance — Easy
- Count Above Average — Easy
- Factorial — Easy
- FizzBuzz — Easy
- GC Content — Easy
- Hex to Decimal — Easy