Number Complement

The complement of an integer is formed by flipping every bit in its binary representation up to (and including) the highest set bit. Given a non-negative integer num, return its bitwise complement.

Examples
Input: 5
Output: 2
Hints

Number Complement

The complement of an integer is formed by flipping every bit in its binary representation up to (and including) the highest set bit. Given a non-negative integer num, return its bitwise complement.