Pregunta de entrevista de Odessa

Leetcode easy problem which can be solved in 2 mins.