Pergunta de entrevista da empresa JPMorganChase

leetcode problem I had to solve