166. Path With Minimum Effort

Given a heights grid heights. The effort of a path is the maximum absolute height difference between adjacent cells along the path. Return the minimum effort of a path from (0,0) to (n-1,m-1).
Example 1
Input: heights = [[1,2,3],[3,8,4],[5,3,5]]
Output: 1
Explanation: Path with smaller height difference.
Example 2
Input: heights = [[1,2,2],[3,8,2],[5,3,5]]
Output: 2
Explanation: Minimum path effort is 2.
graph
JavaScript
Loading...
Line 1, Char 1