Given an m x n grid of integers heights, find the minimum effort required to travel from the top-left cell (0, 0) to the bottom-right cell (m - 1, n - 1). You may move up, down, left, or right. The effort of a path is the maximum absolute difference in heights between any two consecutive cells on that path. Return the minimum possible effort as an integer.
Example 1:
Input: heights = [[1,2,2],[3,8,2],[5,3,5]]
Output: 2
Explanation: A path exists where the largest adjacent height difference is 2.
Example 2:
Input: heights = [[1,2,3],[3,8,4],[5,3,5]]
Output: 1
Explanation: The best path keeps the maximum step difference to 1.
1 <= m, n <= 1001 <= heights[i][j] <= 10^6