Set Clear

Problem Statement

You will be given a number N. Clear the rightmost set bit of the number and print the result.

Input Format:

An integer N

Output Format:

Print the output

Constraints:

  • Time Limit: 50 seconds
  • Memory Limit: 256 MB
Sample Input
Sample Output

Solution

file_type_python set_clear.py
n = int(input())
print(n & (n - 1))

Comments

Load Comments