Pergunta de entrevista da empresa Bloomberg

Solve a coding question leetcode medium