Maximize the largest number K such that bitwise and of K till N is 0 |  ; Function to find maximum value of k which makes bitwise AND zero . ; Finding the power less than N ; Driver Code
import math NEW_LINE def findMaxK ( N ) : NEW_LINE INDENT p = math . log ( N ) // math . log ( 2 ) ; NEW_LINE return int ( pow ( 2 , p ) ) ; NEW_LINE DEDENT N = 5 ; NEW_LINE print ( findMaxK ( N ) - 1 ) ; NEW_LINE