Solution for FlipBits question