-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathArray2D.java
36 lines (31 loc) · 975 Bytes
/
Array2D.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// ______ __ __ __ __
///\ ___\ /\ \/\ \ /\_\_\_\
//\ \ \____\ \ \_\ \\/_/\_\/_
// \ \_____\\ \_____\ /\_\/\_\
// \/_____/ \/_____/ \/_/\/_/
public class Program {
public static void main(String[] args) {
// Test your method here
int[][] matrix = {
{3, 2, 7, 6},
{2, 4, 1, 0},
{3, 2, 1, 0}
};
System.out.println(arrayAsString(matrix));
}
public static String arrayAsString(int[][] array){
StringBuilder sb = new StringBuilder();
for(int i = 0; i < array.length; i++){
for(int j = 0; j < array[i].length; j++){
sb.append(array[i][j]);
}
sb.append("\n");
}
return sb.toString();
}
}
//keep taking care of your goals,
//mental health, self care, recognize
//cognitive distortions and rebel against them!!
//one step at a time, don't be afraid to
//ask 4 help or to fail at times.