Pregunta de entrevista de Meta

Leet code average difficulty problem