• + 11 comments

    If it helps: Don't think about flipping the rows and columns... There are too many possible outcomes.

    Instead, think about what values you can get into the different places. For example, in (0,0) you can get any of the 4 corners. Keep that pattern going and you should start to see a pretty simple algorithm present itself.