how does xor work code example
Example 1: XOR
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
ONLY ONE CAN BE TRUE
Example 2: example use xor in
const findOdd = (xs) => xs.reduce((a, b) => a ^ b);
// this is arrow function
0 | 0 | 0
0 | 1 | 1
1 | 0 | 1
1 | 1 | 0
ONLY ONE CAN BE TRUE
const findOdd = (xs) => xs.reduce((a, b) => a ^ b);
// this is arrow function