← MakeMyTrip questions
CodingModerately ToughReported in a candidate post, Aug 2021

Find path to the end of a maze with doors and walls using special glasses

Filed under MakeMyTrip

Free read 3 of 3

Use BFS where state is (row, col, glass_type).

The question

Find the minimum time to reach the bottom-right of a grid maze containing walls and doors, given two types of glasses that allow passing through walls or doors respectively.

Constraints

  • Grid size N x M
  • Two types of glasses
  • Minimum time/steps

Approach

  1. Use BFS where state is (row, col, glass_type).

Tips

  • What they are testing: Tests graph traversal algorithms (BFS) and state management.
  • Common mistake: Treating the state as just (x, y) instead of (x, y, current_glass).

Related MakeMyTrip questions

Collected from public candidate posts and coding forums. Updated Nov 2026.