We define S
to be a sequence of distinct sequential integers from 1 to n
; in other words, {1,2,3,...,n}
.
We want to know the maximum bitwise AND value of any two integers, a
and a
(where a < b
), in sequence S
that is also less than a given integer, k
.
Complete the function so that given n
and k
, it returns the maximum a & b < k
.
- 1 <=
q
<= 103 - 2 <=
n
<= 103 - 2 <=
k
<=n
3
5 2
8 5
2 2
1
4
0