We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0bbc32d commit 73a4661Copy full SHA for 73a4661
unn04012/array/delete_min_num.js
@@ -0,0 +1,10 @@
1
+function solution(arr) {
2
+ const answer = [];
3
+ const minNum = Math.min(...arr);
4
+
5
+ for (const e of arr) {
6
+ if (e === minNum) continue;
7
+ answer.push(e);
8
+ }
9
+ return answer.length ? answer : [-1];
10
+}
0 commit comments