-Code
import java.util.*;
import java.util.stream.Collectors;
class Solution {
public String solution(String s) {
List<Integer> list = Arrays.stream(s.split(" "))
.mapToInt(Integer::parseInt)
.boxed()
.collect(Collectors.toList());
return Collections.min(list) + " " + Collections.max(list);
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] JadenCase 문자열 만들기 (0) | 2025.02.28 |
---|---|
[프로그래머스/Java] 최솟값 만들기 (0) | 2025.02.28 |
[프로그래머스/Java] 문자열 나누기 (0) | 2025.02.27 |
[프로그래머스/Java] 둘만의 암호 (0) | 2025.02.27 |
[프로그래머스/Java] [1차] 다트 게임 (0) | 2025.02.27 |