You are given an array of size N and element K. You have to find a sub array of size K whose XOR of all elements is minimum possible.
Print minimum XOR.
a^a=0 using this property we can solve this question also we have to use two pointers to solve this in O(N).
Every time we take one element from front and take xor. At the same time we remove the first element from the subarray by taking xor of that in total xor.
For example, a^b^c=total xor then a^b^c^d^a=b^c^d=total xor
Everytime we store the minimum xor.
Please comment below if you have any questions, alternate solutions, or suggestions.