← All problemsSign in

3287. Find the Maximum Sequence Value of Array

LeetCodeArrayDynamic ProgrammingBit ManipulationOpen on judge ↗

You are given an integer array nums and a positive integer k. The value of a sequence seq of size 2 * 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 size 2 * k. Example 1: Input: nums = [2,6,7], k = 1 Output: 5 Explanation: The subsequence [2, 7] has the maximum val

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start