You are viewing a single comment's thread. Return to all comments →
Typscript
function breakingRecords(scores: number[]): number[] { let maxScore = scores[0]; let minScore = scores[0]; let maxBreaks = 0; let minBreaks = 0; for (let i = 1; i < scores.length; i++) { if (scores[i] > maxScore) { maxScore = scores[i]; maxBreaks++; } else if (scores[i] < minScore) { minScore = scores[i]; minBreaks++; } } return [maxBreaks, minBreaks]; }
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 →
Typscript