Hello @ganesh_6
Simple math and observation is enough. First read this to know about cumulative XOR of numbers from 1 to n.
Now, observe that upto n, cumulative XOR for n / 2 numbers (specifically, for all numbers i, such that i % 2 = 0), numbers will be greater than 1. Also, that will be in increasing order (easy to prove using the link I have provided earlier). Another n / 4 numbers (for all numbers i, such that i % 4 = 1) cumulative XOR is 1 and remaining numbers (for all numbers i, such that i % 4 = 3) cumulative XOR is 0.
My correct submission can be seen here.
If you can’t think logically, use brute force to observe these type of things.