Pregunta de entrevista de Meta

Two coding questions for each round.