Implement a function called bitwise_complement that calculates the bitwise complement of a given non-negative integer ( N ).
Functionality
The function should take a single integer ( N ) as input and return its bitwise complement. The bitwise complement of a number is the number that, when combined with the original number using a bitwise OR operation, results in a number where all bits are set to 1. In other words, the complement flips all bits in the binary representation of the number.
Input/Output Requirements
Input:
An integer ( N ) (0 ≤ ( N ) ≤ ( 10^6 )).
Output:
An integer representing the bitwise complement of ( N ).
Implementation
The solution must be written in a file called /app/solution.py.
In the file, the function bitwise_complement should be defined following the provided signature:
python
def bitwise_complement(N: int) -> int:
# implementation here
Example
If the input is 5, the output should be 2.
Explanation: The binary representation of 5 is 101. The complement is 010, which is 2.
Make sure to test the function with various values of ( N ) to ensure its correctness.