Problem Link : Problem Link : Black in Black
In solution , It is written take unique values in queries and mod with 2 because pressing twice is means doing nothing. I understood but let's say you first pressed 6th button then every 6th button state changes and later on you pressed 3rd button so, it will change every 3rd button states but I want to say that 3rd button pushing also changing the states of 6th button so, pressing count of 6th button is taken twice. Please suggest how count of pressing unique values working.
What do you mean by "pressing unique values"?
The official solution is actually telling you to accumulate changes for each button and every kth after, which should anser your doubts that pressing 3rd affecting 6th.