Help needed in clash credenz 2019 question

Link to the question. Can someone please share their approach?

only 2^i and (2^i)-1 will have same function values with some corner case. so u can segment tree to keep count

Can you please give a rough sketch of proof?

i dont have proof it is kind of observation

then how did you land on such a nice (wierd) observation? Any hint how to proceed in such type of problems

1 Like

You can brute too, to get the observation as well

2 Likes