(int num)
| 1 | class Solution { |
| 2 | public int findComplement(int num) { |
| 3 | |
| 4 | int numberOfBits = numberOfBits(num); |
| 5 | |
| 6 | return num ^ ((1 << numberOfBits) - 1); |
| 7 | } |
| 8 | |
| 9 | /** |
| 10 | * Method to find out the total number of bits in a number. |
nothing calls this directly
no test coverage detected