MAXAND18 - Editorial

Video Explanation->Codechef June Lunchtime 2020 || Maximum AND || MAXAND18 (Interesting Problem with clear explanation) - YouTube

Hey Man, I was solving this question today and I was also using the same approach of taking bitwise β€œor” of all Input numbers first, but our approach is wrong, take this case for example.

n = 4, k = 2, arr = [3,4,5,1]
Our answer would be 6 but the correct answer is 5, because 3 bits of β€˜1’ at 2^0 base would be greater than 1 bit of β€˜1’ at 2^1 base.

why in setter’s solution, (50-i) is paired instead of i.
also, during calculating ans, power[50-v[i].second] is used. therefore, it will be power[50-(50-i)]=power[i]… so what is the sense of using (50-i).
@dean_student
plz clarify this.
@chemthan
@taran_1407

https://www.codechef.com/viewsolution/38317357

above given is my solution link, if anyone can please let me know why my code only passes partial test cases and where its failing at. Thanks in advanced