# 2545. Sort the Students by Their Kth Score ###### tags: `Leetcode` `Medium` `Sorting` Link: https://leetcode.com/problems/sort-the-students-by-their-kth-score/description/ ## Code ### Java ```java= class Solution { public int[][] sortTheStudents(int[][] score, int k) { Arrays.sort(score, (a, b) -> b[k] - a[k]); return score; } } ``` ### Python The ```sort()``` method doesn't return any value. Rather, it changes the original list If you want a function to return the sorted list rather than change the original list, use ```sorted()``` ```python= class Solution: def sortTheStudents(self, score: List[List[int]], k: int) -> List[List[int]]: return sorted(score, key = lambda a : -a[k]) ``` ```python= class Solution: def sortTheStudents(self, score: List[List[int]], k: int) -> List[List[int]]: score.sort(key = lambda a : -a[k]) return score ```