We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0ef929 commit d3a178aCopy full SHA for d3a178a
LiiNi-coder/202511/01 PGM 구명보트.md
@@ -0,0 +1,23 @@
1
+```java
2
+import java.util.*;
3
+
4
+class Solution {
5
+ public int solution(int[] people, int limit) {
6
+ Arrays.sort(people);
7
+ int left = 0;
8
+ int right = people.length - 1;
9
+ int answer = 0;
10
+ while(left <= right){
11
+ if(people[left] + people[right] <= limit){
12
+ left++;
13
+ right--;
14
+ } else {
15
16
+ }
17
+ answer++;
18
19
+ return answer;
20
21
+}
22
23
+```
0 commit comments