You are viewing a single comment's thread. Return to all comments →
my java solution
List<Integer> b = new ArrayList<>(); int hscore=scores.get(0),lscore=scores.get(0); int hcount=0,lcount=0; for(int i=1;i<scores.size();i++){ if(scores.get(i)>hscore){ hscore=scores.get(i); if(hscore>=scores.get(i)){ hcount++; } else{ continue; } } if(scores.get(i)<lscore){ lscore=scores.get(i); if(lscore<=scores.get(i)){ lcount++; } else{ continue; } } } b.add(hcount); b.add(lcount); return b; } }
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 →