Pregunta de entrevista de JPMorganChase

Leetcode easy, nothing difficult really