3287. Find the Maximum Sequence Value of Array
You are given an integer array
nums
and a positive integerk
.The value of a sequence
seq
of size2 * x
is defined as:
(seq[0] OR seq[1] OR ... OR seq[x - 1]) XOR (seq[x] OR seq[x + 1] OR ... OR seq[2 * x - 1])
.Return the maximum value of any subsequence of
nums
having size2 * k
.
c++
1 | class Solution { |