Given a matrix like below, transform it, say, 90 degrees into the second matrix below. How would you go about doing this in the cleanest way possible? Short/succinct/clear solutions where the point is easy to grasp is preferred.
From
[[A1,A2,A3],
[B1,B2,B3],
[C1,C2,C3]]
To
[[A1,B1,C1],
[A2,B2,C2],
[A3,B3,C3]]
Edit: I realize it was not clear from original question. I’d like to know how to do this in Erlang.
Simplifying the solutions already given, you can do it in as short as: