USACO Silver Left Out Solution Clarification

Hi, I was recently doing the 2019 US Open problem Left Out.

While reading the solution, I understand the part about the invariant, but could someone explain/prove why flipping the top row and column is enough to find the answer? As in:

For example, couldn’t we possibly flip the rows and columns for the first elements to match, and not get all rows and columns to, say, ‘L’. Then flip the rows and columns another way, and end up with all 'L’s?

Thx in advance

1 Like