Pregunta de entrevista de J.P. Morgan

Given a string, sort its words