Company: Infosys_8thaug
Difficulty: easy
Maximum Value After One Bit Flip Problem Description You are given an array arr of N non-negative integers and a non-negative integer K . For each element arr[i] , do the following: 1. Compute value = arr[i] XOR K . 2. Take a 32-bit register whose bits are all 0 , and change exactly one of its bits from 0 to 1 . If bit position p is chosen (positions are numbered 0 to 31 , position 0 being the least significant), the register holds 2^p . 3. The result for this choice is value + 2^p . You may pick the element and the bit position independently. Report the largest result that can be obtained over all elements of the array and all 32 bit positions. Input Format The first line contains an integer N — the number of elements in the array. The second line contains N space-separated integers — the elements of arr . The third line contains an integer K . Output Format Print a single integer — the maximum value obtainable. Constraints 1 <= N <= 10^5 0 <= arr[i] <= 10^9 0 <= K <