0
0
Fork 0

nicer input reading

paul
Lothar Buchholz 5 years ago
parent 31a0bee25b
commit 9aa4d18153

@ -1,9 +1,7 @@
package rxjava;
import java.util.Scanner;
import java.util.Spliterator;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
/**
* stream.Solution involving a SudokuVerifier, and some RxJava processing.
@ -12,9 +10,7 @@ class Solution {
public static void main( String[] args ) {
// Setup stream on System.in
Scanner in = new Scanner( System.in );
Spliterator spliterator = ((Iterable) () -> in).spliterator();
Stream<String> digitStream = StreamSupport.stream(spliterator, false);
Stream<String> digitStream = new Scanner( System.in ).tokens();
// Setup SudokuVerifier
SudokuVerifier verifier = new SudokuVerifier(digitStream);
// Verify and print out result

Loading…
Cancel
Save