Skip to content

Latest commit

 

History

History
executable file
·
11 lines (6 loc) · 585 Bytes

68e6.md

File metadata and controls

executable file
·
11 lines (6 loc) · 585 Bytes

Back to questions

Solution to 68e6: Using Stream.reduce

See code at solutions/code/tutorialquestions/question68e6

Compare your solution to the sample code.

Note the use in the sample code of Integer.MAX_VALUE and Integer.MIN_VALUE to get the largest and smallest representable integer values, respectively.

That findMinOfMaxes works by mapping findMax over a streamed version of listOfLists. It is necessary to collect the result of this map operation back to a list in order to invoke findMin on the result.