We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int min = scores.get(0);
int max = scores.get(0);
int minB = 0;
int maxB = 0;
for(int s : scores) {
if(s<min) {
minB++;
min = s;
}
if(s>max) {
maxB++;
max = s;
}
}
List<Integer> outputs = new ArrayList<Integer>();
outputs.add(maxB);
outputs.add(minB);
return outputs;
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Breaking the Records
You are viewing a single comment's thread. Return to all comments →
Java: