Pergunta de entrevista da empresa Bloomberg

Similar to medium difficulty leetcode questions.