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.
public static List breakingRecords(List scores) {
// Write your code here
List score = new ArrayList<>();
int min = scores.get(0), max = scores.get(0);
int minc = 0, maxc = 0;
for (Integer integer : scores) {
if(integermax){
max = integer;
maxc += 1;
}
}
score.add(maxc);
score.add(minc);
return score;
}
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 →
public static List breakingRecords(List scores) { // Write your code here List score = new ArrayList<>(); int min = scores.get(0), max = scores.get(0); int minc = 0, maxc = 0; for (Integer integer : scores) { if(integermax){ max = integer; maxc += 1; } } score.add(maxc); score.add(minc); return score; }