Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Created June 26, 2016 14:23
Show Gist options
  • Save polyglotpiglet/12e3d26dcb4f4d1f9fbba5f2b05270dd to your computer and use it in GitHub Desktop.
Save polyglotpiglet/12e3d26dcb4f4d1f9fbba5f2b05270dd to your computer and use it in GitHub Desktop.
public static void main(String... args) {
int[] data = new int[100_000];
Random random = new Random();
for (int i = 0; i< 100_000; i++) {
data[i] = random.nextInt();
}
int max = Integer.MIN_VALUE;
for (int x : data) {
max = Math.max(max, x);
}
System.out.println(max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment