Created
July 6, 2021 09:59
-
-
Save schauhan232/6391821abfcf670de761dc404212ff90 to your computer and use it in GitHub Desktop.
HackerRank Grading Students
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Complete the 'gradingStudents' function below. | |
* | |
* The function is expected to return an INTEGER_ARRAY. | |
* The function accepts INTEGER_ARRAY grades as parameter. | |
*/ | |
public static List<int> gradingStudents(List<int> grades) | |
{ | |
return grades.Select(grade=>{ | |
if(grade %5 < 3 || grade < 38){ | |
return grade; | |
} | |
return grade + (5 - grade %5); | |
}).ToList(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment