Dsa
Graphs Bfs
Warm-up
Warehouse Robot Navigation
A warehouse is represented by an R x C grid. The robot starts at 'S', needs to reach the charging station 'E', and must avoid obstacles marked '#'. Empty floors are marked '.'. The robot can move Up, Down, Left, or Right. Find the minimum steps to reach 'E'. If impossible, print -1.
Example:
Input:
3 3
S . .
. # .
. . E
Output:
4
Key concepts
graphsbfsgrid traversal
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now