Return the XOR of every number from left to right (both included): left ^ (left + 1) ^ ... ^ right.
The starter code xors the numbers one by one. It is correct but far too slow for large ranges.
Example 1
Input:
xor_of_range(3, 9)
Output:
2
Example 2
Input:
xor_of_range(5, 5)
Output:
5
0 <= left <= right <= 10**12No results yet
Run your code to check it against the examples, or submit to run every test.