CODEIT02 - PICK UP DROP ESCAPE
PICK UP DROP ESCAPE
You are given with an array of n numbers. You must pick K elements from the array such that XOR of all the chosen elements is maximum.
The first line consists of an integer t representing the number of test cases. For each test case the first line consists of two numbers n and K denoting the number of elements in the array and the number of elements to be chosen respectively. Then in the next n lines, the elements in the array are given.
For each test case print a line containing one integer denoting the maximum XOR value of the chosen K elements.
Can I apply bitmask approach here >?
[spoiler removed]Last edit: 2019-11-04 16:29:10
Best Solution :)Last edit: 2015-06-04 08:57:57
did this just after XMAX. Didnt interpret the question clearly. got 4-5 WA.