+ 13
[ASSIGNMENT] Rotating a matrix to 90 degrees
Given a matrix represented as int[a][a], Rotate it 90 degrees anticlockwise in-place. ( In place means minimal extra memory to be used, ie, don't make a new array to copy into)? For Example Input : 1 2 3 4 5 6 7 8 9 Output : 3 6 9 2 5 8 1 4 7 Bonus: Rotate it 90 degrees clockwise in-place.
12 Answers
+ 13
A good occasion to train my python list comprehension:
the code transforms a matrix in place in many ways. You can change the matrix size at the code's line 3.
https://code.sololearn.com/cRMGu3jC6l8D/#py
Thanks for this challenge, Pawan. Advice : you should edit your question with [Assignment] in the title to make it more visible. That's the keyword Sololearners are now used to see : )
+ 7
Not in place but in one line https://code.sololearn.com/cT4TViVRNfJ5/?ref=app
+ 7
I used a rotating Matrix to solve this Challenge:
https://code.sololearn.com/cc6cM7kQqQrM/?ref=app
+ 5
yeah! i'm very happy with your question...from past 10 days.i'm studying NUMPY...i have some doubts in SLICING...now i'm clear...
thank you for this challange...
https://code.sololearn.com/cox43bn4M8bw/?ref=app
+ 4
[Advice], thank you Cépagrave
+ 3
~ swim ~ yep . you can add ^.-
+ 3
yeah! i'm on my way to my first answer