I believe the question requires us to find the highestOne bit without using the built-in library.

```
public int findComplement(int num)
{
if(num<=0) return 1;
// Find the higestOne
int highestOne=-1;
for(int i=0;i<32;i++)
{
if(((num>>i)&1)==1)
highestOne=i;
}
// Generate the Mask
int mask = 0xFFFFFFFF ^ (0xFFFFFFFF << (highestOne+1));
// XOR the Mask
return num ^ mask;
}
```