8000
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 cbf5fe3 commit d02cab9Copy full SHA for d02cab9
src/main/java/com/fishercoder/solutions/_867.java
@@ -2,11 +2,11 @@
2
3
public class _867 {
4
public static class Solution1 {
5
- public int[][] transpose(int[][] A) {
6
- int[][] result = new int[A[0].length][A.length];
7
- for (int i = 0; i < A.length; i++) {
8
- for (int j = 0; j < A[0].length; j++) {
9
- result[j][i] = A[i][j];
+ public int[][] transpose(int[][] matrix) {
+ int[][] result = new int[matrix[0].length][matrix.length];
+ for (int i = 0; i < matrix.length; i++) {
+ for (int j = 0; j < matrix[0].length; j++) {
+ result[j][i] = matrix[i][j];
10
}
11
12
return result;
0 commit comments