3277. Maximum XOR Score Subarray Queries
You are given an array
numsofnintegers, and a 2D integer arrayqueriesof sizeq, wherequeries[i] = [li, ri].For each query, you must find the maximum XOR score of any subarray of
nums[li..ri].The XOR score of an array
ais found by repeatedly applying the following operations onaso that only one element remains, that is the score:
- Simultaneously replace
a[i]witha[i] XOR a[i + 1]for all indicesiexcept the last one.- Remove the last element of
a.Return an array
answerof sizeqwhereanswer[i]is the answer to queryi.
1 | int dp[2020][2020], dpp[2020][2020]; |