Java one line solution without using AND (&) or XOR (^)
To find complement of num = 5 which is 101 in binary.\nFirst ~num gives ...11111010 but we only care about the rightmost 3 bits.\nThen to erase the 1s before 01
To find complement of ```num = 5``` which is ```101``` in binary.\nFirst ```~num``` gives ```...11111010``` but we only care about the rightmost 3 bits.\nThen to erase the ```1```s before ```010``` we can add ```1000```\n\n```\n    public int findComplement(int num) {\n        return ~num + (Integer.highestOneBit(num) << 1);\n    }\n```
[]