+ 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
6 Réponses
+ 6
https://code.sololearn.com/cblCu89M0A1e/?ref=app
+ 5
My attempt:
https://code.sololearn.com/cZo72HqLMNSI/?ref=app
+ 4
https://code.sololearn.com/cb4Ad7CxCn48/?ref=app
0
I didn't get any solution.