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