Relative Content

Tag Archive for c++arraysalgorithmxor

Smallest element after xor

Starting with array of N positive integers, support Q queries. Each query contains a positive integer i. To answer the query, replace each element of the array with the result of xoring it with i, then output the earliest index of the smallest element in the array. Each query changes the array.