calculateByes static method

int calculateByes(
  1. int N
)

Calculates the number of BYE (miễn đấu) slots required for N players.

Implementation

static int calculateByes(int N) {
  if (N <= 1) return 0;
  final int nextPowerOfTwoVal = nextPowerOfTwo(N);
  return nextPowerOfTwoVal - N;
}