You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
Code:
class Solution {public: void rotate(vector> &matrix) { int n=matrix.size(); for(int i=0;i
本文共 335 字,大约阅读时间需要 1 分钟。
You are given an n x n 2D matrix representing an image.
Rotate the image by 90 degrees (clockwise).
Follow up:
Could you do this in-place?
Code:
class Solution {public: void rotate(vector> &matrix) { int n=matrix.size(); for(int i=0;i
转载于:https://www.cnblogs.com/winscoder/p/3423322.html