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.
functionbreakingRecords(scores){// Write your code hereletmaxScore=scores[0];letminScore=scores[0];letmaxCount=0;letminCount=0;for(leti=0;i<scores.length;i++){if(scores[i]>maxScore){maxScore=scores[i];maxCount++;}elseif(scores[i]<minScore){minScore=scores[i];minCount++;}}
return [maxCount, minCount];
}
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 →
JavaScript Solution
return [maxCount, minCount]; }