Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
import java.io.BufferedReader;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
|
||||
public class License {
|
||||
public static void main(String[] args) throws FileNotFoundException, IOException{
|
||||
BufferedReader in = new BufferedReader(new FileReader(args[0]));
|
||||
int max = Integer.MIN_VALUE;
|
||||
LinkedList<String> dates = new LinkedList<String>();
|
||||
String line;
|
||||
int count = 0;
|
||||
while((line = in.readLine()) != null){
|
||||
if(line.startsWith("License OUT ")) count++;
|
||||
if(line.startsWith("License IN ")) count--;
|
||||
if(count > max){
|
||||
max = count;
|
||||
String date = line.split(" ")[3];
|
||||
dates.clear();
|
||||
dates.add(date);
|
||||
}else if(count == max){
|
||||
String date = line.split(" ")[3];
|
||||
dates.add(date);
|
||||
}
|
||||
}
|
||||
System.out.println("Max licenses out: "+max);
|
||||
System.out.println("At time(s): "+dates);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue