Apple Interview Question

Write a function to transpose a matrix