static int numberOfBitsNeededToRepresentNOptions(int i) { ret 32-Int.numberOfLeadingZeros(max(0, i-1)); }