Question Code: XORNEY Prerequisites: Implementation Problem Setter: tds115 Difficulty: Cakewalk Explanation:
Given two integer l and r, you have to find if xor from l to r is even or odd. Basically, you have
to find the number of odd integer between l and r. Since xor of odd 1’s is 1 and xor of even
1’s is 0. You can make 2 cases:
(Let count be the number of odd's)
If l is even and r is even> count=(rl)/2
Else > count=(rl)/2+1
If count is even then ans is even
Else odd. Author’s solution: https://ideone.com/GUjqC5 asked 11 Jan, 18:01
