Math, asked by nonu5415, 1 year ago

Find maximum sum of two subarrays by xoring all the elements

Answers

Answered by Anmol18125
0
maximum XOR subset value in the given set. Expected time complexity O(n).

Examples:

Input: set[] = {2, 4, 5} Output: 7 The subset {2, 5} has maximum XOR value Input: set[] = {9, 8, 5} Output: 13 The subset {8, 5} has maximum XOR value Input: set[] = {8, 1, 2, 12, 7, 6} Output: 15 The subset {1, 2, 12} has maximum XOR value Input: set[] = {4, 6} Output: 6 The subset {6} has maximum XOR value

Note that this problem is different from themaximum subarray XOR. Here we need to find subset instead of subarray.




I hope u understand & I am corret
Similar questions