Skip to content

Commit 3339b11

Browse files
committed
등수 매기기 / 기초
1 parent 3d83222 commit 3339b11

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

JooKangSan/[week9]Sort/Ranking.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function solution(score) {
2+
const sum = score.map((el) => (el[0] + el[1]));
3+
let sortedSum = sum.slice().sort((a, b) => b - a);
4+
5+
return sum.map((el) => sortedSum.indexOf(el) + 1);
6+
}

0 commit comments

Comments
 (0)