Grading Students

  • + 0 comments

    Python 3 solution:

    def gradingStudents(grades: list[int]) -> list[int]:
        for i, grade in enumerate(grades):
            if grade > 37 and (mod_5 := grade % 5) > 2:
                grades[i] = grade + 5 - mod_5
        return grades