Tap here to switch tabs
Problem
Submissions

Problem: Minimum Falling Path Sum II

med
30 min
Try to solve the Minimum Falling Path Sum II problem.

Statement

Given an nimesnn imes n integer matrix grid, return the minimum sum of a falling path with non zero shifts.

A falling path with non zero shifts is a selection of exactly one element from each row of grid such that no two elements chosen in adjacent rows share the same column.

Constraints:

  • n ==== grid.length ==== grid[i].length

  • 1≤1 \leq n ≤200\leq 200

  • −99≤-99 \leq grid[i][j] ≤99\leq 99

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Falling Path Sum II

med
30 min
Try to solve the Minimum Falling Path Sum II problem.

Statement

Given an nimesnn imes n integer matrix grid, return the minimum sum of a falling path with non zero shifts.

A falling path with non zero shifts is a selection of exactly one element from each row of grid such that no two elements chosen in adjacent rows share the same column.

Constraints:

  • n ==== grid.length ==== grid[i].length

  • 1≤1 \leq n ≤200\leq 200

  • −99≤-99 \leq grid[i][j] ≤99\leq 99