We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e91e0e commit df0353bCopy full SHA for df0353b
1 file changed
live9/test98/문제2/조진우.js
@@ -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