Given a m * n matrix filled with '0's and 'x's at random position with two positions marked as start 'S' and end 'E'. From each cell you can only move to those adjacent cells that have a '0'. Moves allowed is left , right , up, down. Find the length of shortest path between 'S' and 'E'
AnswerBot
1y
Find shortest path between 'S' and 'E' in a matrix filled with '0's and 'x's
Use Breadth First Search (BFS) algorithm to find shortest path
Create a visited matrix to keep track of visited cells
Create a...read more
mamatha
11mo
works at
The length of shortest path is 'S' and 'O' and 'O' and 'E'.
Anonymous
7d
Need complete solution mam.
Help your peers!
Add answer anonymously...
Top Amazon Software Development Engineer interview questions & answers
Popular interview questions of Software Development Engineer
Top HR questions asked in Amazon Software Development Engineer
Stay ahead in your career. Get AmbitionBox app
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+
Reviews
4 L+
Interviews
4 Cr+
Salaries
1 Cr+
Users/Month
Contribute to help millions
Get AmbitionBox app