From d3a178ab103269fe57d949dae4f0434d15fa1164 Mon Sep 17 00:00:00 2001 From: LiiNi-coder <97495437+LiiNi-coder@users.noreply.github.com> Date: Sat, 1 Nov 2025 23:13:53 +0900 Subject: [PATCH] =?UTF-8?q?[20251101]=20PGM=20/=20LV2=20/=20=EA=B5=AC?= =?UTF-8?q?=EB=AA=85=EB=B3=B4=ED=8A=B8=20/=20=EC=9D=B4=EC=9D=B8=ED=9D=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...54\353\252\205\353\263\264\355\212\270.md" | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 "LiiNi-coder/202511/01 PGM \352\265\254\353\252\205\353\263\264\355\212\270.md" diff --git "a/LiiNi-coder/202511/01 PGM \352\265\254\353\252\205\353\263\264\355\212\270.md" "b/LiiNi-coder/202511/01 PGM \352\265\254\353\252\205\353\263\264\355\212\270.md" new file mode 100644 index 00000000..418d6e08 --- /dev/null +++ "b/LiiNi-coder/202511/01 PGM \352\265\254\353\252\205\353\263\264\355\212\270.md" @@ -0,0 +1,23 @@ +```java +import java.util.*; + +class Solution { + public int solution(int[] people, int limit) { + Arrays.sort(people); + int left = 0; + int right = people.length - 1; + int answer = 0; + while(left <= right){ + if(people[left] + people[right] <= limit){ + left++; + right--; + } else { + right--; + } + answer++; + } + return answer; + } +} + +```