You are viewing a single comment's thread. Return to all comments →
vector<int> gradingStudents(vector<int> grades) { // grades already passed by value std::transform(grades.begin(), grades.end(), grades.begin(), [] (int grade) { if (grade < 38) return grade; int toNextMultiple = 5 - grade % 5; if (toNextMultiple < 3) { grade += toNextMultiple; } return grade; }); return grades; }
Seems like cookies are disabled on this browser, please enable them to open this website
Grading Students
You are viewing a single comment's thread. Return to all comments →