Toggle Lights on 2D Grid with Bitwise Operations