You are viewing a single comment's thread. Return to all comments →
**my code for java
public static List breakingRecords(List scores) { // Write your code here List result = new ArrayList<>();
int min=0; int max=0; int minVal=0; int maxVal=0; result.add(min); result.add(max); for(int i=0; i<scores.size(); i++) { if(i==0) { min=scores.get(i); max=scores.get(i); } else { if(scores.get(i)>min) { min=scores.get(i); minVal++; result.set(0, minVal); } else if(scores.get(i)<max) { max=scores.get(i); maxVal++; result.set(1, maxVal); } } } 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 →
**my code for java
public static List breakingRecords(List scores) { // Write your code here List result = new ArrayList<>();