Pregunta de entrevista de Infinitas Learning Holding

How would you go about improving this code? What is wrong with this code?