#3148

Maximum Difference Score in a Grid

specialist · 910 · lc medium +31 · 47.8% accepted · 287 likes · top 33%

Description

Given a positive-integer m x n matrix grid, you may move from any cell to any other cell that is below or to the right of it (not necessarily adjacent). The score of moving from value c1 to value c2 is c2 - c1. Make at least one move; return the maximum total score achievable.

Code

1
2
3