You are viewing a single comment's thread. Return to all comments →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/vnovwmHPVXE
vector<int> breakingRecords(vector<int> scores) { int lowest = scores[0], highest = scores[0], lowestCount = 0, highestCount = 0; for(int score: scores){ if(score < lowest){lowestCount++; lowest = score;} if(score > highest){highestCount++; highest = score;} } return {highestCount, lowestCount}; }
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 →
Here is my c++ solution, you can watch the explanation here : https://youtu.be/vnovwmHPVXE