Intuit Interview Question

I felt the Bit manipulation question was a bit tricky.