Sort the Students by Their Kth Score

MediumArraySortingMatrix

Solution

export function sortTheStudents(score: number[][], k: number): number[][] {
  return score.sort((s1, s2) => s2[k] - s1[k]);
}