From 1e98870338e79453a38e28f4c18c2fdd22b83f4a Mon Sep 17 00:00:00 2001 From: yeoncheol-kim Date: Fri, 11 Apr 2025 09:06:35 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9C=20Study:=20=ED=94=BC=EB=A1=9C?= =?UTF-8?q?=EB=8F=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- "\355\224\274\353\241\234\353\217\204.py" | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 "\355\224\274\353\241\234\353\217\204.py" diff --git "a/\355\224\274\353\241\234\353\217\204.py" "b/\355\224\274\353\241\234\353\217\204.py" new file mode 100644 index 0000000..5b9cc42 --- /dev/null +++ "b/\355\224\274\353\241\234\353\217\204.py" @@ -0,0 +1,4 @@ +from itertools import permutations + +def solution(k, dungeons): + return max((lambda t: sum((t := t - j) >= 0 and t + j >= i for i, j in p))(k) for p in permutations(dungeons))