Two Sigma interview question

Question dealing with permutations