Pregunta de entrevista de JPMorganChase

leetcode problem I had to solve