Google Interview Question — LeetCode 1368

Y Tech
2 min readJan 30, 2022

In this post, we are going to discuss leetcode 1368 — Minimum Cost to Make at Least One Valid Path in a Grid, which is recently asked in Google interviews.

Problem Analysis

Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:

1 which means go to the cell to the right. (i.e go from grid[i][j] to grid[i][j + 1])
2 which means go to the cell to the left. (i.e go from grid[i][j] to grid[i][j

--

--