• + 0 comments

    Java script solution

    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];