Uber | Onsite | Matrix Walking Problem

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2018-10-15Added By Anonymous
Source: Link

Company: Uber
Role: unknown
Interview Stage: Onsite
Location: unknown
Year: unknown

Original Post Content:

In a Binary maze with 0 and 1, 0 is the valid cell to which we can travel and 1 means that the cell is blocked. Given source and destination. We have to find-
1. IF path exists, if yes, find shortest path.
2. If we are given a chance to toggle single cell from 1 to 0 , which cell you will toggle so that you will surely get the shortest path.
How to tackle the second part without toggling each cell.
Is there a better way to do the same?

Comments