Airbnb | Phone Screen | Min Steps to Open Doors

Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2019-10-27Added By Anonymous
Source: Link

Hi everybody,

I just had my phone interview with Airbnb. My experience was ok, but luckily, I pass. The only problem was that I felt like talking to a wall all the time during my interview.


The question asked was DFS/BFS

you have a 2D grid of '-1' means a wall, a '' means you can pass, a lowercase character means a door, and an uppercase character means the key of that respective.


Return the minimum steps to open all the doors. You cannot move back (I don't remember to be hones) you just need to traverse the grid up, down, left, right and check if you can open all doors.


I hope this helps.

Comments