题出自https://leetcode.com/problems/rotate-image/ 内容为:

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?

简单的说就是给出一个n*n的二维数组,然后把这个数组进行90度顺时针旋转,而且不能使用额外的存储空间。

最初拿到这道题想到的就是找出每个坐标的旋转规律。假设我们是2*2的矩阵:

a b c d

相关文章:

  • 2022-01-04
  • 2021-11-19
  • 2021-11-06
  • 2021-09-01
  • 2022-12-23
  • 2021-09-23
  • 2021-12-08
  • 2022-01-03
猜你喜欢
  • 2021-11-23
  • 2022-01-31
  • 2022-01-04
  • 2022-12-23
  • 2022-01-06
  • 2021-11-26
  • 2021-12-23
相关资源
相似解决方案