Tap here to switch tabs
Problem
Submissions

Problem: Find the Maximum Sequence Value of Array

Try to solve the Find the Maximum Sequence Value of Array problem.

Statement

You are given an integer array nums and a positive integer k.

The sequence value of a subsequence of length 2⋅k2 \cdot k is calculated by:

  1. Finding the bitwise OR of its first kk elements.

  2. Finding the bitwise OR of its remaining kk elements.

  3. Taking the bitwise XOR of the two resulting values.

Return the maximum possible sequence value achievable from any subsequence of nums having length 2⋅k2 \cdot k.

Constraints:

  • 2≤2 \leq nums.length ≤400\leq 400

  • 1≤1 \leq nums[i] <27< 2^7

  • 1≤1 \leq k ≤\leq nums.length /2/ 2

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Find the Maximum Sequence Value of Array

Try to solve the Find the Maximum Sequence Value of Array problem.

Statement

You are given an integer array nums and a positive integer k.

The sequence value of a subsequence of length 2⋅k2 \cdot k is calculated by:

  1. Finding the bitwise OR of its first kk elements.

  2. Finding the bitwise OR of its remaining kk elements.

  3. Taking the bitwise XOR of the two resulting values.

Return the maximum possible sequence value achievable from any subsequence of nums having length 2⋅k2 \cdot k.

Constraints:

  • 2≤2 \leq nums.length ≤400\leq 400

  • 1≤1 \leq nums[i] <27< 2^7

  • 1≤1 \leq k ≤\leq nums.length /2/ 2