
Find the minimum possible effort to move from the top-left to the bottom-right of a height grid. Moving between adjacent cells costs the absolute height difference, and the effort of a path is the maximum such difference along that path.
heights = [[1,2,2],[3,8,2],[5,3,5]]Output2WhyThe optimal path avoids the steepest jump and keeps the maximum step cost at 2.heights = [[1,2,3],[3,8,4],[5,3,5]]Output1WhyA longer route can still be better if it minimizes the largest adjacent difference.1 <= m, n <= 1001 <= heights[i][j] <= 10^6Moves are allowed only in four directions