Comments

Hmm, managed to find another solution to b, which is also a quick trick, as in the "bonus section": just check whether (x & y) == (y & z) && (x & y) == (x & z). The solution has passed all tests :)

For those, wondering why, my logic was that a & b & c is equal to x & y (because a & b & b & c = a & b & c) and similarly to x & z and y & z, so all these expressions must be equal to each other.