Practice Maximum Difference Score in a Grid
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
You are given an m x n matrix grid consisting of positive integers. You can move from a cell in the matrix to any other cell that is either to the bottom or to the right (not necessarily adjacent). The score of a move from a cell with the value c1 to a cell with the value c2 is c2 - c1. You can start at any cell, and you have to make at least one move. Return the maximum total score you can achieve.
Source: Maximum Difference Score in a Grid on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
grid = [[9,5,7,3],[8,9,6,1],[6,7,14,3],[2,5,3,1]]
9
# Example 2
grid = [[4,3,2],[3,2,1]]
-1
Constraints
Related LeetCode Problems
Practice more problems similar to Maximum Difference Score in a Grid.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.