프로그래머스 42885번
https://school.programmers.co.kr/learn/courses/30/lessons/42885?language=java
import java.util.*;
class Solution {
public int solution(int[] people, int limit) {
Arrays.sort(people);
int n = people.length;
int ans = 0;
int low = 0;
int high = n - 1;
while(low <= high) {
if(people[low] + people[high] <= limit) {
low++;
}
high--;
ans++;
}
return ans;
} // End of solution()
} // End of Solution class