From b7d4e34626bc2bd5f2d1ad687b7c84a220182afa Mon Sep 17 00:00:00 2001 From: gamjalee <68909554+gamjalee@users.noreply.github.com> Date: Sun, 17 Jul 2022 00:03:15 +0900 Subject: [PATCH] =?UTF-8?q?[=EC=9D=B4=EC=A7=80=EC=98=81]=2018=EC=A3=BC?= =?UTF-8?q?=EC=B0=A8=2072411=EB=B2=88=20=EA=B3=BC=EC=A0=9C=20=EC=A0=9C?= =?UTF-8?q?=EC=B6=9C=ED=95=A9=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 72411_py_jy.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 72411_py_jy.py diff --git a/72411_py_jy.py b/72411_py_jy.py new file mode 100644 index 0000000..80f1e3c --- /dev/null +++ b/72411_py_jy.py @@ -0,0 +1,16 @@ +from itertools import combinations +from collections import Counter + +def solution(orders, course): + answer = [] + for cs in course: + tmp = [] + for od in orders: + cb = combinations(sorted(od), cs) + tmp += cb + ct = Counter(tmp) + if len(ct) != 0 and max(ct.values()) != 1: + answer += [''.join(ff) for ff in ct if + ct[ff] == max(ct.values())] + answer = sorted(answer) + return answer \ No newline at end of file