Given:
You wants to make the reduction operation parallelized.
Which two modifications will accomplish this?
Replace line 1 with int sum = numbers. Stream (). Interate (0, a -> a+1. Reduce (0, (n m) -> n+m);
Replace line 1with int sum = numbers. ParallelStream ( ). Reduce (0, (n, m ) -> n + m);
Replace line 1 with int sum = numbers. Parallel ( ). Stream ( ). Reduce (0, (n, m ) -> n + m);
Replace line 1with int sum = number. Stream ( ) . flatMap (a -> a) .reduce (0, (n, m) -> n +m );
Replace line 1with int sum = number.stream. parallel ( ). Reduce (0, (n, m) -> n + m);
Submit