Pregunta de entrevista de Motive

Code the solution and then general discussion