We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
publicstaticList<Integer>gradingStudents(List<Integer>grades){// Write your code hereList<Integer>newGrades=newArrayList<Integer>();intstudents=grades.size();for(inti=0;i<students;i++){intfactor=(grades.get(i)/5)+1;if(grades.get(i)<38){newGrades.add(grades.get(i));}elseif(factor*5-grades.get(i)<3){newGrades.add(factor*5);}else{newGrades.add(grades.get(i));}}returnnewGrades;}
Cookie support is required to access HackerRank
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 →