Skip to content

Commit

Permalink
등수 매기기
Browse files Browse the repository at this point in the history
  • Loading branch information
dudwns committed Jun 11, 2023
1 parent 766df7e commit 0a22242
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Programmers/exam87.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
function solution(score) {
const answer = [];
const average = score.map((n, index) => (n[0] + n[1]) / 2);
let sorted = average.slice().sort((a, b) => b - a);
return average.map((n) => sorted.indexOf(n) + 1);
}

0 comments on commit 0a22242

Please sign in to comment.