Domanda di colloquio di CIMON

Asked me to solve a leetcode easy question