Skip to content

Instantly share code, notes, and snippets.

@asela38
Created May 16, 2018 04:56
Show Gist options
  • Save asela38/2655c13981ef35dfad9d8c5724a18864 to your computer and use it in GitHub Desktop.
Save asela38/2655c13981ef35dfad9d8c5724a18864 to your computer and use it in GitHub Desktop.
Generate basic statistics for 1 Billion data set of Integers
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
class OneBillionIntegerStatistics {
public static void main(String[] args) throws IOException {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream("numbers_1B.in")))) {
System.out.print(reader.lines().mapToLong(Long::valueOf).summaryStatistics());
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment