HACKER Q&A
📣 amichail

Which, if any, AIs can code a correct solution to this puzzle?


You are given an array of n x n integers.

The goal is to end up with an array in which all entries are equal.

Four kinds of moves are allowed:

(1) rotate a row

(2) rotate a column

(3) add 1 to all entries in a row

(4) add 1 to all entries in a column

Show the goal is achievable if and only if the sum of the numbers in the initial configuration is congruent to 0 mod n.

Also write a python program to solve the puzzle whenever it is possible to do so.


  👤 tromp Accepted Answer ✓
The real challenge, for humans as well, is to code an efficient solution. Which probably requires solving the first part.

👤 curiousObject
What operation or transformation does rotate mean?