2545. Sort the Students by Their Kth Score ¶ Time: $O(mn\log m)$ Space: $O(mn)$ C++JavaPython 1 2 3 4 5 6 7 8 9class Solution { public: vector<vector<int>> sortTheStudents(vector<vector<int>>& score, int k) { ranges::sort(score, [k](const vector<int>& a, const vector<int>& b) { return a[k] > b[k]; }); return score; } }; 1 2 3 4 5 6class Solution { public int[][] sortTheStudents(int[][] score, int k) { Arrays.sort(score, (a, b) -> Integer.compare(b[k], a[k])); return score; } } 1 2 3class Solution: def sortTheStudents(self, score: list[list[int]], k: int) -> list[list[int]]: return sorted(score, key=lambda x: -x[k])