Skip to content

Instantly share code, notes, and snippets.

@jraregris
Created October 29, 2009 12:58
Show Gist options
  • Save jraregris/221425 to your computer and use it in GitHub Desktop.
Save jraregris/221425 to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.Collections;
class Juks{
static final int MAX = 1000000;
static ArrayList<Integer> a = new ArrayList<Integer>(MAX);
public static void main(String args[]){
lagList();
int teller = 0;
int min = a.get(0);
for(Integer i: a){
if(i<min){
min = i;
teller++;
}
}
System.out.println(teller);
}
private static void lagList(){
for(int i = 0;i<MAX;i++)
a.add(i);
Collections.shuffle(a);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment