Pergunta de entrevista da empresa J.P. Morgan

Quant puzzles, Sorting based questions