You are viewing a single comment's thread. Return to all comments →
My solution in C#
static int[] gradingStudents(int[] grades) {
List<int> resp = new List<int>(); foreach (int value in grades){ if(value >= 38){ if(value % 5 == 0){ resp.Add(value); } else { int multiFive = value; while(multiFive % 5 != 0){ multiFive++; } if((multiFive - value) < 3){ resp.Add(multiFive); } else { resp.Add(value); } } } else { resp.Add(value); } } return resp.ToArray(); }
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 →
My solution in C#
static int[] gradingStudents(int[] grades) {