public void run() {
        final int[][] minSums = new int[DIM][DIM];
        minSums[0][0] = 4445;
        for(int i = 0; i < DIM; i++) {
            for(int j = 0; j < DIM; j++) {
                if(i == 0 && j == 0) { continue; }

                if(j == 0) { // top row, sum must come from left
                    minSums[i][j] = minSums[i - 1][j] + get(i, j);
                }
                else if(i == 0) { // left row, sum must come from above
                    minSums[i][j] = minSums[i][j - 1] + get(i, j);;
                }
                else { // mid-grid, consider both cases
                    final int leftSum = minSums[i - 1][j] + get(i, j);
                    final int topSum = minSums[i][j - 1] + get(i, j);
                    minSums[i][j] = Math.min(leftSum, topSum);
                }
            }
        }
        //Strings.print(minSums);
        this.answer = minSums[DIM - 1][DIM - 1];
    }