We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a000e26 commit 0f2bd4bCopy full SHA for 0f2bd4b
โrotate-image/soobing.ts
@@ -0,0 +1,25 @@
1
+/**
2
+ * ๋ฌธ์ ์ค๋ช
3
+ * - 2์ฐจ์ ๋ฐฐ์ด์ 90๋ in-place๋ก ํ์ ํ๊ธฐ
4
+ *
5
+ * ์์ด๋์ด
6
+ * 1) ๋๊ฐ์ ์ด๋ + ์ข์ฐ ์ด๋
7
8
+ */
9
10
+ Do not return anything, modify matrix in-place instead.
11
12
+function rotate(matrix: number[][]): void {
13
+ const n = matrix.length;
14
+ for (let i = 0; i < n; i++) {
15
+ for (let j = i + 1; j < n; j++) {
16
+ const temp = matrix[i][j];
17
+ matrix[i][j] = matrix[j][i];
18
+ matrix[j][i] = temp;
19
+ }
20
21
+
22
23
+ matrix[i].reverse();
24
25
+}
0 commit comments