Pergunta de entrevista da empresa IGT

algorithmic question about O(n) complexity