Count of N | Function to find the value of X to the power Y ; Stores the value of X ^ Y ; If y is odd , multiply x with result ; Update the value of y and x ; Return the result ; Function to count number of arrays having element over the range [ 0 , 2 ^ K - 1 ] with Bitwise AND value 0 having maximum possible sum ; Print the value of N ^ K ; Driver Code
def power ( x , y ) : NEW_LINE INDENT res = 1 NEW_LINE while ( y > 0 ) : NEW_LINE INDENT if ( y & 1 ) : NEW_LINE INDENT res = res * x NEW_LINE DEDENT y = y >> 1 NEW_LINE x = x * x NEW_LINE DEDENT return res NEW_LINE DEDENT def countArrays ( N , K ) : NEW_LINE INDENT print ( power ( N , K ) ) NEW_LINE DEDENT N = 5 ; NEW_LINE K = 6 ; NEW_LINE countArrays ( N , K ) NEW_LINE