Apple interview question

Write a function to transpose a matrix