Pregunta de entrevista de CIMON

Asked me to solve a leetcode easy question