4 ms·
Ask HN: When will AI be able to write efficient code to solve 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
A "rotation" means you shift the items one position in the row/column (in either direction) with wrap around.
First, show the goal is achievable if and only if the sum of the numbers in the initial configuration is congruent to 0 mod n.
Then, write an efficient python program to solve the puzzle whenever it is possible to do so.
- not_your_vase 2y agoOn Friday. At 2:37 AM.
- nobody9999 2y agoEven sooner if you write such code and post it online for the LLMs to steal^W scrape and regurgitate.