Morgan Stanley interview question

write code to sort multi-dimension array