You are viewing a single comment's thread. Return to all comments →
#Solution in java
public static List breakingRecords(List scores) {
int maxCount = 0; int minCount = 0; int min = scores.get(0); int max = scores.get(0); for(int element:scores){ if(element < min){ min = element; minCount++; } else if(element > max){ max = element; maxCount++; } } scores.removeAll(scores); scores.add(maxCount); scores.add(minCount); return scores; }
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 →
#Solution in java
public static List breakingRecords(List scores) {