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...
Amazon Software Development Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
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

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter