Skip to content

Commit df0353b

Browse files
committed
98차 2번 문제풀이
1 parent 5e91e0e commit df0353b

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

live9/test98/문제2/조진우.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const fs = require("fs");
2+
const inputData = fs
3+
.readFileSync("./input.txt", "utf8")
4+
// .readFileSync("/dev/stdin", "utf8")
5+
.toString()
6+
.trim();
7+
8+
function solution(inputData) {
9+
const num = inputData.split("");
10+
const soltResult = num.sort((a, b) => b - a).join("");
11+
12+
return soltResult === inputData ? "0" : soltResult;
13+
}
14+
15+
console.log(solution(inputData));

0 commit comments

Comments
 (0)