https://www.acmicpc.net/problem/1427
1427번: 소트인사이드
첫째 줄에 정렬하려고 하는 수 N이 주어진다. N은 1,000,000,000보다 작거나 같은 자연수이다.
www.acmicpc.net
const fs = require('fs');
const input = fs.readFileSync('/dev/stdin').toString().trim();
const arr = input.split("").map(i => Number(i));
arr.sort(function(a,b) {
return b - a;
});
console.log(arr.join(""));
728x90
'Algorithm&CodingTest > Baekjoon' 카테고리의 다른 글
[Baekjoon] [2566] 브론즈3 - 최댓값 Node.js (0) | 2023.02.24 |
---|---|
[Baekjoon] [1371] 가장 많은 글자 (0) | 2023.02.24 |
[Baekjoon] [11650] 실버5 - 좌표 정렬하기 NodeJs (0) | 2023.02.24 |
[Baekjoon] [10828] 스택/큐 - 스택 (0) | 2023.02.24 |
[Baekjoon] [10845] 큐/스택 - 큐 (0) | 2023.02.23 |