Pergunta de entrevista da empresa Citi

Question based on pattern matching.