Pergunta de entrevista da empresa Eastern Enterprise

It was a logic based puzzle question