just sorting an array and updating max for every two consecutive elements is getting accepted(100 marks) .

For the input 10 4 2 1 , answer according to above algorithm will be 0. (10&4 =0 , 4&2 = 0, 2&1 = 0) .

But the correct answer should be 10 & 2 = 2.

link: Solution with this algo that got accepted

The solutions should be rejudged.