Skip to content

Commit 723e510

Browse files
committed
특이한 정렬 / 기초
1 parent a1643d8 commit 723e510

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function solution(numlist, n) {
2+
var answer = [];
3+
4+
answer = numlist.sort((a,b) => (Math.abs(n-a) - Math.abs(n-b)) || (b-a));
5+
6+
return answer;
7+
}

0 commit comments

Comments
 (0)