-Code
import java.util.*;
import java.util.stream.Collectors;
class Solution {
public int[] solution(int[] arr) {
List<Integer> arr_list = Arrays.stream(arr).boxed()
.collect(Collectors.toList());
arr_list.remove(Collections.min(arr_list));
if (arr_list.isEmpty()) arr_list.add(-1);
return arr_list.stream().mapToInt(Integer::intValue).toArray();
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] 내적 (0) | 2025.02.24 |
---|---|
[프로그래머스/Java] 핸드폰 번호 가리기 (0) | 2025.02.24 |
[프로그래머스/Java] 없는 숫자 더하기 (0) | 2025.02.24 |
[프로그래머스/Java] 콜라츠 추측 (0) | 2025.02.24 |
[프로그래머스/Java] 서울에서 김서방 찾기 (0) | 2025.02.24 |