From 68e3a321048176635d1efdc7af69246c5507dac4 Mon Sep 17 00:00:00 2001 From: wjddydwns Date: Tue, 14 Oct 2025 17:58:59 +0900 Subject: [PATCH] =?UTF-8?q?[PGS]=20/=20=EC=A0=95=EC=9A=A9=EC=A4=80=20/=20?= =?UTF-8?q?=EC=98=88=EC=82=B0=20/=2020=EB=B6=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../[week 2]/pgs_\354\230\210\354\202\260.py" | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 "JungYongJoon/[week 2]/pgs_\354\230\210\354\202\260.py" diff --git "a/JungYongJoon/[week 2]/pgs_\354\230\210\354\202\260.py" "b/JungYongJoon/[week 2]/pgs_\354\230\210\354\202\260.py" new file mode 100644 index 0000000..56524cd --- /dev/null +++ "b/JungYongJoon/[week 2]/pgs_\354\230\210\354\202\260.py" @@ -0,0 +1,12 @@ +def solution(d, budget): + d.sort() + answer = 0 + total = 0 + for i in range(len(d)): + if(total + d[i] <= budget): + total += d[i] + answer += 1 + else : + break + return answer + \ No newline at end of file