OkCupid interview question

Performant matrix transposition.