From f0999b44fc057761b63959c0c23d4580daf7e8cd Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Sat, 13 Dec 2025 12:25:51 +0900 Subject: [PATCH] =?UTF-8?q?[20251213]=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=EA=B0=95=ED=98=84?= 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" | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 "lkhyun/202512/13 PGM Lv2 \352\265\254\353\252\205\353\263\264\355\212\270.md" diff --git "a/lkhyun/202512/13 PGM Lv2 \352\265\254\353\252\205\353\263\264\355\212\270.md" "b/lkhyun/202512/13 PGM Lv2 \352\265\254\353\252\205\353\263\264\355\212\270.md" new file mode 100644 index 00000000..312ae9cb --- /dev/null +++ "b/lkhyun/202512/13 PGM Lv2 \352\265\254\353\252\205\353\263\264\355\212\270.md" @@ -0,0 +1,20 @@ +```java +import java.util.*; +class Solution { + public int solution(int[] people, int limit) { + int answer = 0; + Arrays.sort(people); + int left = 0; + int right = people.length-1; + + while(left <= right){ + int rest = limit - people[right--]; + answer++; + if(rest >= people[left]){ + left++; + } + } + return answer; + } +} +```