can u explain how 10 is coming in the sample o/p?
Not able to understand the o/p
@kodivine0
The question is asking us to look in the range 1 - 4. Here the indexing is 1 based. You thus look at the first 4 numbers and after the xors of each of them with 6, you can conclude that 6 has the maximum xor with the element 10. This is how 10 was returned.
If my explanation was able to resolve your query, please mark the doubt as resolved.