Pergunta de entrevista da empresa Microsoft

maze question - more complex than in first thought