https://www.acmicpc.net/problem/1181
const fs = require('fs');
const ip = fs.readFileSync('/dev/stdin').toString().split('\n');
const n = Number(ip[0]);
ip.shift();
let input = new Set(ip);
input = Array.from(input);
input.sort(function(a,b) {
if(a.length !== b.length) return a.length - b.length;
else {
return a > b ? 1 : -1;
}
});
input.forEach((i, index) => {
console.log(i);
});
728x90
'Algorithm\CodingTest > Baekjoon' 카테고리의 다른 글
[Beakjoon] [1436] 브루트 포스 - 영화감독 숌 (0) | 2023.02.23 |
---|---|
[Baekjoon] [2231] 브루트 포스 - 분해합 (0) | 2023.02.23 |
[Baekjoon] [1712] 손익분기점 (0) | 2023.02.11 |
[Baekjoon] [9093] 단어 뒤집기 (0) | 2023.02.10 |
[Baekjoon] [10808] 알파벳 개수 (0) | 2023.02.10 |