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 hereintmaxCount=0;intminCount=0;intmin=scores.get(0);intmax=scores.get(0);for(intscore:scores){if(min<score){minCount++;min=score;}elseif(max>score){maxCount++;max=score;}}returnArrays.asList(minCount,maxCount);}
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 8+ solution