코드
class Solution {
public int[] solution(int[] arr) {
if(arr.length == 1){
int[] answer = {-1};
return answer;
}
int[] answer = new int[arr.length-1];
int min =0;
for(int i=0; i<arr.length; i++){
if(arr[min]>arr[i]){
min = i;
}
}
for(int i=min+1;i<arr.length;i++){
arr[i-1] = arr[i];
}
for(int i=0;i<answer.length;i++){
answer[i] = arr[i];
}
return answer;
}
}