HTMLify

LeetCode - Sort the Students by Their Kth Score - Go
Views: 2 | Author: abh
func sortTheStudents(score [][]int, k int) [][]int {
    for i:=0; i<len(score); i++ {
        for j:=i; j<len(score); j++ {
            if score[i][k] < score[j][k] {
                score[i], score[j] = score[j], score[i]
            }
        }
    }
    return score
}

Comments