
Given a grid of heights, return the minimum possible effort needed to move from the top-left cell to the bottom-right cell. The effort of a path is the maximum absolute difference between adjacent cells along that path, and movement is allowed in four directions.
heights = [[1,2,2],[3,8,2],[5,3,5]]Output2WhyThe optimal path avoids the largest jumps and keeps the maximum step cost at 2.heights = [[1,2,3],[3,8,4],[5,3,5]]Output1WhyA path exists where every adjacent difference is at most 1.`1 <= m, n <= 100``1 <= heights[i][j] <= 10^6`Move only up, down, left, or right