import java.util.*; class Solution { public int[] solution(int[] arr) { if(arr.length == 1) return new int[]{-1}; int[] clone = arr.clone(); Arrays.sort(clone); int min = clone[0]; int[] answer = new int[arr.length - 1]; int i = 0; int j = 0; while (i < arr.length) { if (arr[i] != min) { answer[j] = arr[i]; i++; j++; } else i++; } return answer; } }