https://codeforces.com/contest/1299/problem/A
//above is the link
Please help me with the Logic.
@keshari,
Just read its editorial, it is explained well enough there.
Basically for any ith element, swap it with a[1], then F(a)=a[1]&(~a[2])&(~a[3])…&(~a[n])
where ~ means compliment.
So. do the for each ‘i’ and print the max found.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.