Pergunta de entrevista da empresa Lazard

Leetcode medium question, ML and transformers