Min Time to Visit Cell in Grid

Navigate a grid where each cell has a minimum entry time. Move to adjacent cells in 1 second; if you arrive early, wait by bouncing between cells. Find the earliest time to reach the bottom-right cell, or -1 if impossible.

Examples
Input: [[0,1,3,2],[5,1,2,5],[4,3,8,6]]
Output: 7
Hints

Min Time to Visit Cell in Grid

Navigate a grid where each cell has a minimum entry time. Move to adjacent cells in 1 second; if you arrive early, wait by bouncing between cells. Find the earliest time to reach the bottom-right cell, or -1 if impossible.