We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
for A in range(1, N + 1):
for B in range(A + 1, N + 1):
current_val = A & B
if current_val < K and current_val > max_val:
max_val = current_val
return max_val
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 29: Bitwise AND
You are viewing a single comment's thread. Return to all comments →
*python***
def bitwiseAnd(N, K): max_val = 0