| 7 | class Solution { |
| 8 | public: |
| 9 | int findComplement(int num) { |
| 10 | int inv = 0, iter = 0; |
| 11 | int reminder; |
| 12 | while(num) { |
| 13 | inv = inv | ((1 - (num % 2))<<iter); |
| 14 | num /= 2; |
| 15 | iter++; |
| 16 | } |
| 17 | return inv; |
| 18 | } |
| 19 | }; |
| 20 |
nothing calls this directly
no outgoing calls
no test coverage detected