You are given a large range [a,b] where \'a\' and \'b\' can be typically between 1 and 4,000,000,000 inclusive. You have to find out the XOR of all the numbers in the given
To support XOR from 0 to N the code given needed to be modified as below,
int f(int a) { int []res = {a, 1, a+1, 0}; return res[a % 4]; } int getXor(int a, int b) { return f(b) ^ f(a); }