weiren1998 / weiren1998.github.io

This is my blog.
1 stars 0 forks source link

面试金典0107 旋转矩阵 | J球星的博客 #12

Open weiren1998 opened 2 years ago

weiren1998 commented 2 years ago

https://weiren1998.github.io/archives/924acc2a.html

题目: 给你一幅由 N × N 矩阵表示的图像,其中每个像素的大小为 4 字节。请你设计一种算法,将图像旋转 90 度。 不占用额外内存空间能否做到? 12345678910111213141516171819202122232425262728293031# 样例1给定 matrix = [ [1,2,3], [4,5,6], [7,8,9]],原地旋转输入矩阵,使其变为:[ [7,4,