Skip to content

Commit 082d0b9

Browse files
committed
제일 작은 수 제거하기 / 중급
1 parent 12ffb31 commit 082d0b9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
function solution(arr) {
2+
var answer = [];
3+
4+
if (arr[0] === 10) {
5+
return [-1];
6+
}
7+
8+
for (let i = 0; i < arr.length; i++) {
9+
for (let j = 0; j < arr.length; j++) {
10+
if (arr[i] > arr[j]) {
11+
answer.push(arr[i]);
12+
}
13+
}
14+
}
15+
16+
return [...new Set(answer)];
17+
}

0 commit comments

Comments
 (0)