You are viewing a single comment's thread. Return to all comments →
Java Solution
public static List breakingRecords(List scores) {
int higestScore = scores.get(0); int lowestScore = scores.get(0); int breaksRecordCounter = 0; int recordLowCounter = 0; List<Integer> result = new ArrayList<>(); for (int i = 1; i < scores.size(); i++) { if (scores.get(i) > higestScore) { higestScore = scores.get(i); breaksRecordCounter++; } if (scores.get(i) < lowestScore) { lowestScore = scores.get(i); recordLowCounter++; } } result.add(breaksRecordCounter); result.add(recordLowCounter); return result; }
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 Solution
public static List breakingRecords(List scores) {