You are viewing a single comment's thread. Return to all comments →
vector breakingRecords(vector scores) {
vector<int> ans; int minCount = 0; int maxCount = 0; int maxi = scores[0]; int mini = scores[0]; for(int i = 1; i<scores.size(); i++){ if(scores[i] == maxi || scores[i] == mini){ } else if(maxi > scores[i]){ maxCount++; maxi = scores[i]; } else if (mini < scores[i]){ minCount++; mini = scores[i]; } } ans.push_back(minCount); ans.push_back(maxCount); return ans;
}
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 →
Using C++
vector breakingRecords(vector scores) {
}