Max Points with Cost

Given an m x n matrix of points, pick one cell from each row to maximize total points. Moving from column i to column j costs |i - j| points.

Examples
Input: [[1,2,3],[1,5,1],[3,1,1]]
Output: 9
Hints

Max Points with Cost

Given an m x n matrix of points, pick one cell from each row to maximize total points. Moving from column i to column j costs |i - j| points.