• + 0 comments

    Here is my c++ solution, you can find video here : https://youtu.be/fYcSakw_5-M

    vector<int> gradingStudents(vector<int> grades) {
        vector<int> result;
        for(int i = 0; i < grades.size(); i++){
            int mo = grades[i] % 5;
            if(mo < 3 || grades[i] < 38) result.push_back(grades[i]);
            else result.push_back(grades[i] - mo + 5);
        }
        return result;
    }