Pregunta de entrevista de Viagogo

refactor a poorly written code segment