Pregunta de entrevista de Bloomberg

How to structure the data when it is messy?