From 8a8cf1aa11af55b80964bb661c284603020cc337 Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Thu, 23 Oct 2025 20:07:14 +0900 Subject: [PATCH] =?UTF-8?q?[20251023]=20PGM=20/=20Lv2=20/=20=ED=8A=9C?= =?UTF-8?q?=ED=94=8C=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 --- .../202510/23 PGM Lv2 \355\212\234\355\224\214.md" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "lkhyun/202510/23 PGM Lv2 \355\212\234\355\224\214.md" diff --git "a/lkhyun/202510/23 PGM Lv2 \355\212\234\355\224\214.md" "b/lkhyun/202510/23 PGM Lv2 \355\212\234\355\224\214.md" new file mode 100644 index 00000000..1a5843ad --- /dev/null +++ "b/lkhyun/202510/23 PGM Lv2 \355\212\234\355\224\214.md" @@ -0,0 +1,14 @@ +```python +def solution(s): + answer = [] + unions = s[2:-2].split("},{") + + dic = {} + for union in unions: + u = list(map(int, union.split(","))) + for i in u: + dic[i] = dic.get(i,0) + 1 + + dic = sorted(dic.items(),key=lambda x : x[1],reverse=True) + return [x[0] for x in dic] +```