Corvil interview question

Bit manipulation