The TransCompilator

Solved LeetCode program · 926 of 1,000

#1289 · Minimum Falling Path Sum II

Hard Array chunk-19.md

Original English source

The cells is a list of 1, 2, 3, 4, 5, 6, 7, 8, and 9. The scores is a list of 9 zeros. For every column from 0 to 2, set item column of scores to item column of cells.
For every level from 1 to 2.
For every column from 0 to 2.
The index is level times 3 plus column. The best is 1000000.
For every prior from 0 to 2.
The above is (level minus 1) times 3 plus prior. The candidate is item above of scores plus item index of cells. If prior is not column and candidate is less than best, set best to candidate. If prior is 2, set item index of scores to best.

The answer is item 6 of scores.
For every column from 1 to 2.
If item (6 plus column) of scores is less than answer, set answer to item (6 plus column) of scores.

Show answer.

Open in Playground Browse all 1,000 problems

Expected stdout

13