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.
let min = scores[0];
let max = scores[0];
let minRecord = 0;
let maxRecord = 0;
for(let i=1; i < scores.length; i++){
if(scores[i] < min ) {
min = scores[i];
minRecord=minRecord+1;
}
if(scores[i] > max ) {
max = scores[i];
maxRecord=maxRecord+1;
}
}
return [maxRecord,minRecord];
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 →
Java script solution