Pergunta de entrevista da empresa Bloomberg

A question similar to the Word Break LeetCode question