# Flip Bits

Determine the number of bits required to flip if you want to convert integer n to integer m.

Example
Given `n = 31`

(`11111`

), `m = 14`

(`01110`

), return `2`

.

We first use the XOR operator `^`

to find the different bits. Then we use the expression `n & (n - 1)`

, which removes the lowest `1`

bit. This is called Kernighanâ€™s Bit Counting Algorithm.