回答編集履歴

2

修正

2021/06/02 07:28

投稿

ozwk
ozwk

スコア13553

test CHANGED
@@ -12,7 +12,7 @@
12
12
 
13
13
  int [][] numbers = {{1, 2, 3}, {4, 5}, {6}};
14
14
 
15
- var arr = Arrays.stream(numbers)
15
+ var result = Arrays.stream(numbers)
16
16
 
17
17
  .map( xs ->
18
18
 
@@ -28,7 +28,7 @@
28
28
 
29
29
 
30
30
 
31
- System.out.println(arr);
31
+ System.out.println(result);
32
32
 
33
33
  }
34
34
 

1

整形

2021/06/02 07:28

投稿

ozwk
ozwk

スコア13553

test CHANGED
@@ -12,15 +12,23 @@
12
12
 
13
13
  int [][] numbers = {{1, 2, 3}, {4, 5}, {6}};
14
14
 
15
- var result = Arrays.stream(numbers)
15
+ var arr = Arrays.stream(numbers)
16
16
 
17
+ .map( xs ->
18
+
19
+ Arrays.stream(xs)
20
+
21
+ .mapToObj(x -> String.valueOf(x))
22
+
17
- .map( xs -> Arrays.stream(xs).mapToObj(x -> String.valueOf(x)).collect(Collectors.joining(" ")))
23
+ .collect(Collectors.joining(" "))
24
+
25
+ )
18
26
 
19
27
  .collect(Collectors.joining("\n"));
20
28
 
21
29
 
22
30
 
23
- System.out.println(result);
31
+ System.out.println(arr);
24
32
 
25
33
  }
26
34