Pergunta de entrevista da empresa AKUNA CAPITAL

It was around a leetcode medium-hard