Skip to content

Commit

Permalink
#18 23.09.03 > 5 > 역원소 정렬
Browse files Browse the repository at this point in the history
  • Loading branch information
beurmuz committed Sep 3, 2023
1 parent 1252241 commit bfbe359
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/bj/silver/5/5648.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

const [N, ...arr] = require("fs")
.readFileSync("/dev/stdin")
.toString()
.trim()
.split(/\s/)
.map((v) => +v);

const solution = (N, arr) => {
let answer = arr
.map((num) => {
return Number(num.split("").reverse().join(""));
})
.sort((a, b) => a - b);
return answer.join("\n");
};

console.log(solution(N, arr));
1 change: 1 addition & 0 deletions src/bj/silver/5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@
| 33 | 14916 | [거스름돈](./14916.js) | 23.06.09 | O |
| 34 | 7785 | [회사에 있는 사람](./7785.js) | 23.07.25 | O |
| 35 | 10815 | [숫자 카드](./10815.js) | 23.08.29 | O |
| 36 | 5648 | [역원소 정렬](./5648.js) | 23.09.03 | O |

0 comments on commit bfbe359

Please sign in to comment.