Microsoft interview question

maze question - more complex than in first thought