You are viewing a single comment's thread. Return to all comments →
func gradingStudents(grades: [Int]) -> [Int] { // Write your code here grades.map{ grade in if grade > 37 { let diff = 5 - (grade%5); return diff < 3 ? grade + diff : grade; } else { return grade; } } }
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 →
func gradingStudents(grades: [Int]) -> [Int] { // Write your code here grades.map{ grade in if grade > 37 { let diff = 5 - (grade%5); return diff < 3 ? grade + diff : grade; } else { return grade; } } }