Skip to content

Latest commit

 

History

History
29 lines (25 loc) · 870 Bytes

README.md

File metadata and controls

29 lines (25 loc) · 870 Bytes

some-tricks-coding-interview

some tricks of coding interview basic logic

Write in with 🤍 and Golang

LIST

Codewars

func gradingStudents(grades []int32) []int32 {
    var result []int32
    for i := 0; i < len(grades); i++ {
        if grades[i] >= 38 {
            var mod = grades[i] % 5
            if mod >= 3 {
                grades[i] += 5 - mod
            }
        }
        result = append(result, grades[i])
    }
    return result
}