[프로그래머스] 구명보트 (javascript)

최대 2명의 조건이 있다. 몸무게가 많이 나가는 사람을 기준으로 해야된다. 만약 여러명을 태울 수 있다면 while문안의 if문을 while로 수정하면 된다. function solution(people, limit) { var answer = 0; people.sort((a,b)=>a-b); let left=0,right=people.length-1; let sum=0; while(left