최소힙, 최대힙 으로 풀었다
이렇게 쉬운문제가 나오면 의심부터 하게된다;;
import java.util.*;
class Solution {
public String solution(String s) {
String answer = "";
Queue<Integer> pq = new PriorityQueue<>();
Queue<Integer> rpq = new PriorityQueue<>(Collections.reverseOrder());
String[] input = s.split(" ");
for(int i = 0; i < input.length; ++i)
{
pq.add(Integer.parseInt(input[i]));
rpq.add(Integer.parseInt(input[i]));
}
answer = pq.poll() + " " + rpq.poll();
return answer;
}
}