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.
publicstaticList<Integer>breakingRecords(List<Integer>scores){// Write your code hereList<Integer>list=newArrayList();inttempMax=scores.get(0);inttempMin=tempMax;inthighestScore=0;intlowestScore=0;for(Integeri:scores){if(i>tempMax){highestScore++;tempMax=i;}elseif(i<tempMin){lowestScore++;tempMin=i;}}list.add(highestScore);list.add(lowestScore);returnlist;}
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 →
my java solution: