Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // https://www.geeksforgeeks.org/calculate-xor-1-n/
- int Xor(int N) {
- switch(N & 3) {
- case 0:
- return N;
- case 1:
- return 1;
- case 2:
- return N + 1;
- default:
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement