BNY Interview Question

And they asked me how would you transpose a matrix. Write the code in your preferred language!!