+ 5

Maximum AND (&)

Given an array of elements, you can pick at most one element of the array and increment or decrement it by any value. The task is to maximize the AND of the resulting array. Note: AND of the array is defined as the bitwise AND(&) of the the array elements. Input : N = 3 A[] = { 1, 2, 3 } Output: 2 Input : N = 2 A[] = { 10, 10 } Output: 10 Credit: GeeksForGeeks

21st Nov 2021, 2:49 PM
Mohd Aadil
Mohd Aadil - avatar
6 Answers
21st Nov 2021, 6:27 PM
Oma Falk
Oma Falk - avatar
+ 6
https://code.sololearn.com/cblCu89M0A1e/?ref=app
23rd Nov 2021, 7:59 PM
Johann
Johann - avatar
22nd Nov 2021, 4:34 AM
Steve
Steve - avatar
+ 4
https://code.sololearn.com/cb4Ad7CxCn48/?ref=app
27th Nov 2021, 9:00 AM
michal
29th Nov 2021, 4:31 PM
Coding Cat
Coding Cat - avatar
0
I didn't get any solution.
22nd Nov 2021, 4:27 PM
SANSKAR
SANSKAR - avatar