Pergunta de entrevista da empresa Odessa

Leetcode easy problem which can be solved in 2 mins.