The simple, yet not so simple answer, is because AND/addition is closed under binary.
so in binary, 1 + 1 == 2, which is outside of the domain of binary number for a single bit, making it 0. Meaning, in binary, the default OR is an XOR. so that is why you have the %2 to treat it as a bit.
For further details, look into Rings.. that will give you a deeper understanding.
The simple, yet not so simple answer, is because AND/addition is closed under binary.
so in binary, 1 + 1 == 2, which is outside of the domain of binary number for a single bit, making it 0. Meaning, in binary, the default OR is an XOR. so that is why you have the %2 to treat it as a bit.
For further details, look into Rings.. that will give you a deeper understanding.
https://en.wikipedia.org/wiki/Ring_(mathematics)
This comment is hidden because it contains spoiler information about the solution