Skip to content

Commit b46dcf6

Browse files
refactor 48
1 parent 3fa3bcc commit b46dcf6

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/java/com/fishercoder/solutions/_48.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.fishercoder.solutions;
22

3+
import com.fishercoder.common.utils.CommonUtils;
4+
35
/**
46
* 48. Rotate Image
57
@@ -63,6 +65,7 @@ public void rotate(int[][] matrix) {
6365
matrix[j][i] = tmp;
6466
}
6567
}
68+
CommonUtils.print2DIntArray(matrix);
6669

6770
/**then reverse*/
6871
for (int i = 0; i < m; i++) {

src/test/java/com/fishercoder/_48Test.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,16 @@ public void test5() {
7373
solution3.rotate(matrix);
7474
CommonUtils.print2DIntArray(matrix);
7575
}
76+
77+
@Test
78+
public void test6() {
79+
matrix = new int[][]{
80+
{1, 2, 3, 4},
81+
{5, 6, 7, 8},
82+
{9, 10, 11, 12},
83+
{13, 14, 15, 16}
84+
};
85+
solution1.rotate(matrix);
86+
CommonUtils.print2DIntArray(matrix);
87+
}
7688
}

0 commit comments

Comments
 (0)