Given an n×n binary matrix image, flip each row horizontally and invert it. To flip: reverse each row. To invert: replace 0→1, 1→0 (XOR with 1).
image = [[1,1,0],[1,0,1],[0,0,0]][[1,0,0],[0,1,0],[1,1,1]]Flip reverses the row, invert flips each bit. When L≠R: one is 0, one is 1. Flipping swaps them, inverting flips them back — net effect is zero change. When L=R: flip does nothing, just invert. When L=R and both same value — XOR both with 1.