You are viewing a single comment's thread. Return to all comments →
C++
vector<int> breakingRecords(vector<int> scores) { int high=scores[0]; int low=scores[0]; int highcnt=0; int lowcnt=0; for(int i=1;i<scores.size();i++){ if(scores[i]>high){ high=scores[i]; highcnt++; } else if(scores[i]<low){ low=scores[i]; lowcnt++; } } return {highcnt,lowcnt}; }
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 →
C++