
Maximum XOR for Each Query - Leetcode 1829 - Java
34
5________
Problem Description
You are given a sorted array nums of n non-negative integers and an integer maximumBit. You want to perform the following query n times:
Find a non-negative integer k < 2maximumBit such that nums[0] XOR nums[1] XOR ... XOR nums[nums.length-1] XOR k is maximized. k is the answer to the ith query.
Remove the last element from the current array nums.
Return an array answer, where answer[i] is the answer to the ith query.
Problem: leetcode.com/problems/maximum-xor-for-each-query
Code link: k5kc.com/cs/problems/maximum-xor-for-each-query/
コメント