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<Integer> breakingRecords(List<Integer> scores) {
int min = 0;
int max = 0;
int minimum = scores.get(0);
int maximum = scores.get(0);
for(int i = 1; i < scores.size();i++){
int value = scores.get(i);
if(value >maximum){
max++;
maximum = value;
}
if(value < minimum){
min ++;
minimum = value;
}
}
return Arrays.asList(max,min);
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