Question: python def reorient(map): Given a map, we want to rotate it clockwise one quarter turn. This means that the left column becomes the top row,

python def reorient(map): Given a map, we want to rotate it clockwise one quarter turn. This means that the left column becomes the top row, the top row becomes the right column, and so on.

Dont use .reverse()

Assume: map is a map as defined above.

reorient([[1,2],[3,4]]) [[3,1],[4,2]]

reorient([[1,2,3],[4,5,6],[7,8,9],[10,11,12]]) [[10, 7, 4, 1], [11, 8, 5, 2], [12, 9, 6, 3]]

reorient(reorient([[1,2],[3,4]]) [[3,4],[2,1]]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!