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.
Day 29: Bitwise AND
Day 29: Bitwise AND
Sort by
recency
|
429 Discussions
|
Please Login in order to post a comment
any one explain why this code works always int bitwiseAnd(int n, int k) { if (((k - 1) | k) <= n) { return k - 1; } else { return k - 2; } }
PYTHON 3 SOLUTION
python:
JavaScript/TypeScript
the max value before k will be k-1 is it exists print k-1 else k-2 the next largest value before k-1