Skip to content

Commit 1c74f59

Browse files
committed
113차 1번 문제풀이
1 parent 25a658e commit 1c74f59

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const input = require("fs")
2+
.readFileSync(
3+
process.platform === "linux"
4+
? "/dev/stdin"
5+
: require("path").join(__dirname, "input.txt"),
6+
"utf8"
7+
)
8+
.trim()
9+
.split("\n");
10+
11+
function solution(input) {
12+
let index = 0;
13+
const T = Number(input[index++]);
14+
const output = [];
15+
16+
for (let t = 0; t < T; t++) {
17+
const N = Number(input[index++]);
18+
const numbers = [];
19+
20+
for (let i = 0; i < N; i++) {
21+
numbers.push(input[index++]);
22+
}
23+
24+
numbers.sort();
25+
26+
output.push(consistent ? "YES" : "NO");
27+
}
28+
29+
return output.join("\n");
30+
}
31+
32+
console.log(solution(input));

0 commit comments

Comments
 (0)