Pergunta de entrevista da empresa Autodesk

solve 1 leetcode medium level question