Search
⌘K

Leetcode 2997. Minimum Number of Operations to Make Array XOR Equal to K

Given an array and integer k, determine the minimum number of single-bit flips (you may flip any bit of any element, including leading zeros) required so that the bitwise XOR of all elements equals k. The core challenge is optimizing bit-level toggles across elements (bits can be treated independently) under constraints n ≤ 1e5 and values ≤ 1e6.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Your account is free and you can post anonymously if you choose.