Available question text
Given an array and a bit-width, for each query (removing the last element each time) find k < 2^maximumBit that maximizes the XOR of all current elements with k. This reduces to maintaining the cumulative XOR of the array and returning k as its bitwise complement under the mask (2^maximumBit - 1) for each step.
Related questions
Continue with questions that share topics or the same question type.
- Given an array nums and a sliding window of size k moving from the very left to the very right, return the maximum value in the window for each position. Solve in O(n) time using a deque.
Coding
- Maximal Range That Each Element Is Maximum in It
Coding
- Maximum Genetic Difference Query
Coding
- Maximum Strong Pair XOR I
Coding
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1829. Maximum XOR for Each Query
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source