Pergunta de entrevista da empresa AGDATA

You're given an easy logical problem to code.