You are viewing a single comment's thread. Return to all comments →
Solution in JS
function breakingRecords(scores) { let lowestScore = scores[0] let highestScore = scores[0] let highestScoreBeatenCount = 0; let lowestScoreBeatenCount = 0; for (let i = 0; i< scores.length; i++){ if(scores[i] > highestScore){ highestScoreBeatenCount+=1 highestScore = scores[i] }else if (scores[i] < lowestScore){ lowestScoreBeatenCount+=1 lowestScore = scores[i] } } return [highestScoreBeatenCount,lowestScoreBeatenCount ] }
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 →
Solution in JS