Pocket Gems interview question

A key - door path searching question.