## CodeChef: June Challenge | Optimal Xor Set OPTSET | Python, Java, C++ Solution

View problem on codechef Find KK distinct numbers in the range [1,N][1,N] such that the bitwise XOR of all the numbers is maximized. Print any set of these numbers that maximize the XOR. Input The first line contains an integer TT, the number of test cases. Then the test cases follow. Each test case contains a single line of input, two integers NN, KK. …

CodeChef: June Challenge | Optimal Xor Set OPTSET | Python, Java, C++ Solution Read More »