Pregunta de entrevista de Mediastinct

It was a coding question but i didnt remeber