Minimum Time to Visit a Cell In a Grid | Leetcode 2577