You are viewing a single comment's thread. Return to all comments →
A rust solution:
fn gradingStudents(grades: &[i32]) -> Vec<i32> { grades.iter() .map(|&x| { let modulo = 5 - (x % 5); if x >= 38 && (modulo > 0 && modulo < 3) { x + modulo } else { x } }) .collect() }
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 →
A rust solution: