function solution9(arr) {
if (arr.length <= 1) {
return [-1];
} else {
const min = Math.min(...arr);
console.log(min);
// splice(시작index, 갯수)
arr.splice(arr.indexOf(min), 1);
}
return arr;
}
console.log(solution9([4, 3, 2, 1])); // [4,3,2]
console.log(solution9([10])); // [-1]