MCPcopy Create free account
hub / github.com/careercup/ctci / cloneMatrix

Method cloneMatrix

java/Chapter 1/Question1_7/Question.java:117–125  ·  view source on GitHub ↗
(int[][] matrix)

Source from the content-addressed store, hash-verified

115 }
116
117 public static int[][] cloneMatrix(int[][] matrix) {
118 int[][] c = new int[matrix.length][matrix[0].length];
119 for (int i = 0; i < matrix.length; i++) {
120 for (int j = 0; j < matrix[0].length; j++) {
121 c[i][j] = matrix[i][j];
122 }
123 }
124 return c;
125 }
126
127 public static void main(String[] args) {
128 int nrows = 10;

Callers 1

mainMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected