https://easybrother0103.tistory.com/125
풀었음.

import java.util.*;
class Solution {
public int solution(int[] people, int limit) {
int answer = 0;
int length = people.length;
Arrays.sort(people);
int start = 0; int end = length - 1;
for(int i=0; i<length; i++)
{
if(start>end)
{
break;
}
if((people[end] + people[start] <= limit))
{
start++;
}
end--;
answer++;
}
return answer;
}
}
익힐것 :
1. Arrays.sort() : 오름차순 정렬.