Pregunta de entrevista de Curai

Algorithmic question that was very straight forward. Take in some data, parse it, do some logic, and output it in a different format.